about summary refs log tree commit diff stats
path: root/internal/importer/main_test.go
blob: cb4d1db6d6e74426bca6335758143598a44de34f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package importer

import (
	"log/slog"
	"testing"

	"go.alanpearce.eu/searchix/internal/config"
	"go.alanpearce.eu/searchix/internal/index"
)

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)
	}
}