From ef60daef395b20b67042c011f5b2a1131049e275 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Feb 2023 19:50:35 -0700 Subject: rebuildmappings: Optimize the KMP search --- lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go') diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go index 665bc96..cdf5e5a 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go @@ -158,10 +158,6 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect // The fuzzy-search is only fast because the exact-search is so good at getting `physicalBlocks` down. // Empirically: if I remove the exact-search step, then the fuzzy-match step is more than an order of magnitude // slower. - // - // The exact-search probably could be optimized to be substantially faster (by a constant factor; not affecting - // the big-O) by figuring out how to inline function calls and get reduce allocations, but IMO it's "fast - // enough" for now. ctx = dlog.WithField(_ctx, "btrfsinspect.rebuild-mappings.step", "5/6") dlog.Infof(_ctx, "5/6: Searching for %d block groups in checksum map (exact)...", len(bgs)) physicalSums := ExtractPhysicalSums(scanResults) -- cgit v1.2.3-2-g168b