this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

make the did cache not tiny (#399)

who thought 1000 was a good enough number??

authored by

Whyrusleeping and committed by
GitHub
aa07638d ec2345f1

+11 -1
+7
carstore/bs.go
··· 12 12 "sort" 13 13 "strings" 14 14 "sync" 15 + "sync/atomic" 15 16 "time" 16 17 17 18 "github.com/bluesky-social/indigo/models" ··· 165 166 return count > 0, nil 166 167 } 167 168 169 + var CacheHits int64 170 + var CacheMiss int64 171 + 168 172 func (uv *userView) Get(ctx context.Context, k cid.Cid) (blockformat.Block, error) { 169 173 if !k.Defined() { 170 174 return nil, fmt.Errorf("attempted to 'get' undefined cid") ··· 172 176 if uv.cache != nil { 173 177 blk, ok := uv.cache[k] 174 178 if ok { 179 + atomic.AddInt64(&CacheHits, 1) 180 + 175 181 return blk, nil 176 182 } 177 183 } 184 + atomic.AddInt64(&CacheMiss, 1) 178 185 179 186 // TODO: for now, im using a join to ensure we only query blocks from the 180 187 // correct user. maybe it makes sense to put the user in the blockRef
+1 -1
cmd/bigsky/main.go
··· 256 256 } 257 257 mr.AddHandler("web", &webr) 258 258 259 - cachedidr := plc.NewCachingDidResolver(mr, time.Minute*5, 1000) 259 + cachedidr := plc.NewCachingDidResolver(mr, time.Minute*5, 500_000) 260 260 261 261 kmgr := indexer.NewKeyManager(cachedidr, nil) 262 262
+3
repomgr/bench_test.go
··· 2 2 3 3 import ( 4 4 "context" 5 + "fmt" 5 6 "os" 6 7 "path/filepath" 7 8 "testing" ··· 74 75 b.Fatal(err) 75 76 } 76 77 } 78 + 79 + fmt.Println(carstore.CacheHits, carstore.CacheMiss) 77 80 }