mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 23:08:49 +01:00
⚡ Improve document tree expansion and database loading performance https://github.com/siyuan-note/siyuan/issues/12428
This commit is contained in:
parent
d2aec48657
commit
42c9a1210a
2 changed files with 31 additions and 14 deletions
12
kernel/cache/ial.go
vendored
12
kernel/cache/ial.go
vendored
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue