all repos — searchix @ d88d668ef0e29e9b15e384249a04d711b7a94c3d

Search engine for NixOS, nix-darwin, home-manager and NUR users

perf: optimise import batching

Alan Pearce
commit

d88d668ef0e29e9b15e384249a04d711b7a94c3d

parent

84f1c93bbfea63b316665dd3a0bd696ad7bb1856

2 files changed, 3 insertions(+), 2 deletions(-)

changed files
M internal/index/indexer.gointernal/index/indexer.go
@@ -226,6 +226,7 @@ err, fmsg.Withf("could not check if index exists at path %s", indexBaseName))
} kvconfig := map[string]any{ + "unsafe_batch": true, "scorchPersisterOptions": map[string]any{ "NumPersisterWorkers": 8, "MaxSizeInMemoryMergePerWorker": 128 * 1024 * 1024,
M internal/storage/store.gointernal/storage/store.go
@@ -17,7 +17,7 @@ "alin.ovh/searchix/internal/file"
"alin.ovh/searchix/internal/nix" ) -var BatchSize = 10000 +var BatchSize = 50000 type Options struct { Replace bool
@@ -65,7 +65,7 @@ return nil, fault.Wrap(err, fmsg.With("failed to open database"))
} if !opts.LowMemory { - bb.Bolt.AllocSize = 100 * 1024 * 1024 + bb.Bolt.AllocSize = 256 * 1024 * 1024 } return &Store{