aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/match_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 13:50:01 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 13:50:01 +0200
commit78d8313791f05defc9e0a9f2bad8e9710f741a60 (patch)
tree60d9847eb81313dbd242768a1a06e3e4a175a7c3 /internal/engine/match_test.go
parentb596085d2391ce3701fa6820a6728ba634ac453b (diff)
downloadkrino-78d8313791f05defc9e0a9f2bad8e9710f741a60.tar.gz
krino-78d8313791f05defc9e0a9f2bad8e9710f741a60.zip
the suffix search continues instead of starting again at _1
Every file renamed onto one name probed stem_1, stem_2, ... from the beginning, so N files cost N^2/2 Exists calls - a test here counts 1890 of them for 60 files. The search now continues from the highest suffix already tried for that stem. Within one plan that is the same answer: the taken set only grows while a plan is built and the disk is not being written to, so a suffix taken once stays taken. Proved rather than argued - with same_1 and same_3 already on disk and same_2 free, both versions put a file in the gap, and the two plans are byte-identical. 1500 files renamed to one name: 2.63s -> 0.05s
Diffstat (limited to 'internal/engine/match_test.go')
0 files changed, 0 insertions, 0 deletions