diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 13:47:35 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 13:47:35 +0200 |
| commit | b596085d2391ce3701fa6820a6728ba634ac453b (patch) | |
| tree | 4943546cb21326de6195a64bd94eab430a8e1cb1 /internal/kwcache/kwcache_test.go | |
| parent | 6971543d4749574d4ca575c4e8acf04f9e86d6bb (diff) | |
| download | krino-b596085d2391ce3701fa6820a6728ba634ac453b.tar.gz krino-b596085d2391ce3701fa6820a6728ba634ac453b.zip | |
a content class is worked out once, not once per copy
Lookup walked the whole size group for every file in it, so N copies of
one file cost N walks of an N-member group, each taking the index's
lock at every step - which is why more workers made it slower rather
than faster. Every member of a class elects the same original (the
invariant identicalTo already documents and a test already pins), so
the class is memoised on the first walk and every later member is a
map lookup.
Measured over identical files, invented data, same machine:
500 files 0.17s -> 0.12s
2000 files 1.89s -> 0.58s
and the plans are byte-identical once the sandbox path is normalised.
The test counts walks: one per content class, not one per file.
Diffstat (limited to 'internal/kwcache/kwcache_test.go')
0 files changed, 0 insertions, 0 deletions
