🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-26 20:45:39 +08:00
parent 804eeb5e19
commit 13e6ff8557
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -128,11 +128,15 @@ func FlushQueue() {
return
}
if 16 < i && 0 == i%256 {
if 16 < i && 0 == i%128 {
runtime.GC()
}
}
if 128 < len(ops) {
runtime.GC()
}
elapsed := time.Now().Sub(start).Milliseconds()
if 5000 < elapsed {
logging.LogInfof("op tx [%dms]", elapsed)