Improve document tree expansion and database loading performance https://github.com/siyuan-note/siyuan/issues/12428

This commit is contained in:
Daniel 2024-09-09 23:45:04 +08:00
parent d2aec48657
commit 42c9a1210a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 31 additions and 14 deletions

12
kernel/cache/ial.go vendored
View file

@ -24,13 +24,13 @@ import (
)
var docIALCache, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 102400,
MaxCost: 10240,
NumCounters: 1024 * 100,
MaxCost: 1024 * 1024 * 200,
BufferItems: 64,
})
func PutDocIAL(p string, ial map[string]string) {
docIALCache.Set(p, ial, 1)
docIALCache.Set(p, ial, 128)
}
func GetDocIAL(p string) (ret map[string]string) {
@ -55,13 +55,13 @@ func ClearDocsIAL() {
}
var blockIALCache, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 102400,
MaxCost: 10240,
NumCounters: 1024 * 1000,
MaxCost: 1024 * 1024 * 200,
BufferItems: 64,
})
func PutBlockIAL(id string, ial map[string]string) {
blockIALCache.Set(id, ial, 1)
blockIALCache.Set(id, ial, 128)
}
func GetBlockIAL(id string) (ret map[string]string) {