使用sync.pool对象池优化Timer的GC压力

This commit is contained in:
boyce
2020-10-27 15:01:18 +08:00
parent d08da30b84
commit 11cb070da2
2 changed files with 34 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/duanhf2012/origin/profiler"
"github.com/duanhf2012/origin/rpc"
"github.com/duanhf2012/origin/util/timer"
"github.com/duanhf2012/origin/util/timewheel"
"reflect"
"runtime"
"sync"
@@ -147,6 +148,7 @@ func (slf *Service) Run() {
analyzer.Pop()
analyzer = nil
}
timewheel.ReleaseTimer(t)
}
}