This commit is contained in:
Liang Ding 2022-06-29 20:16:00 +08:00
parent 8fccd3a58e
commit 4d4c5b58b9
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 7 additions and 9 deletions

8
kernel/cache/ial.go vendored
View file

@ -24,8 +24,8 @@ import (
)
var docIALCache, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 100000, // 10W
MaxCost: 1024 * 1024 * 10, // 10MB
NumCounters: 200000,
MaxCost: 1000 * 1000 * 32,
BufferItems: 64,
})
@ -55,8 +55,8 @@ func ClearDocsIAL() {
}
var blockIALCache, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 100000, // 10W
MaxCost: 1024 * 1024 * 10, // 10MB
NumCounters: 800000,
MaxCost: 1000 * 1000 * 64,
BufferItems: 64,
})

View file

@ -27,8 +27,8 @@ import (
)
var memCache, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 100000, // 10W
MaxCost: 1024 * 1024 * 10, // 10MB
NumCounters: 800000,
MaxCost: 1000 * 1000 * 100,
BufferItems: 64,
})
var disabled = true
@ -110,9 +110,7 @@ func GetRefsCacheByDefID(defID string) (ret []*Ref) {
return
}
var (
defIDRefsCache = gcache.New(30*time.Minute, 5*time.Minute) // [defBlockID]map[refBlockID]*Ref
)
var defIDRefsCache = gcache.New(30*time.Minute, 5*time.Minute) // [defBlockID]map[refBlockID]*Ref
func CacheRef(tree *parse.Tree, refIDNode *ast.Node) {
ref := buildRef(tree, refIDNode)