diff options
Diffstat (limited to 'internal/importer')
-rw-r--r-- | internal/importer/main_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/importer/main_test.go b/internal/importer/main_test.go new file mode 100644 index 0000000..bbb91a3 --- /dev/null +++ b/internal/importer/main_test.go @@ -0,0 +1,26 @@ +package importer + +import ( + "log/slog" + "searchix/internal/config" + "searchix/internal/index" + "testing" +) + +var cfg = config.DefaultConfig + +func BenchmarkImporterLowMemory(b *testing.B) { + tmp := b.TempDir() + cfg.LogLevel = slog.LevelDebug + _, write, _, err := index.OpenOrCreate(tmp, false, &index.Options{ + LowMemory: true, + }) + if err != nil { + b.Fatal(err) + } + + err = Start(&cfg, write, false, &[]string{"nixpkgs"}) + if err != nil { + b.Fatal(err) + } +} |