Skip to content

Commit 3315e60

Browse files
authored
chore: performance tunning for stable runner (#4670)
1 parent 327ef73 commit 3315e60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/threading/stablerunner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"runtime"
66
"sync"
77
"sync/atomic"
8+
"time"
89
)
910

1011
const factor = 10
@@ -100,6 +101,6 @@ func (r *StableRunner[I, O]) Wait() {
100101
close(r.done)
101102
r.runner.Wait()
102103
for atomic.LoadUint64(&r.consumedIndex) < atomic.LoadUint64(&r.writtenIndex) {
103-
runtime.Gosched()
104+
time.Sleep(time.Millisecond)
104105
}
105106
}

0 commit comments

Comments
 (0)