aboutsummaryrefslogtreecommitdiff
path: root/cmd/bolt/bench.go
blob: 28cbbc3c096cfd7083acd14411a96b9f72fb19bd (plain) (blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main

import (
	"testing"

	"github.com/boltdb/bolt"
)

// Import converts an exported database dump into a new database.
// parallelism: integer representing number of concurrent reads/writes
// readWriteMode: 'read' or 'write'
// traversalPattern: 'sequentrial' or 'random'
func Bench(inputPath string, readWriteMode string, traversalPattern string, parallelism int) {

	// cursor/sequential reads
	// random reads

	// sequential writes
	// random writes

	// reading from many buckets
	// writing to many buckets

	// read from many paths
	// writing to many paths

	// bucket size/messages
	// bucket depth

	// concurrency

	// chart/graph

	// profile

	// benchmarks for getting all keys

	b := bolt.NewBenchmark(inputPath, readWriteMode, traversalPattern, parallelism)

	result := testing.Benchmark(b.Run)

	println(result)
}