From 048d3f19b28ee04dd6b2ca3c8f86e5fa65dc7355 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 15 Jul 2014 07:37:46 -0600 Subject: Add DB.NoSync option for bulk loading. This commit adds the DB.NoSync flag to skip fsync() calls on each commit. This should only be used for bulk loading as it can corrupt your database in the event of a system failure. Initial tests show it can provide a 2x speed up for sequential inserts. --- cmd/bolt/bench.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/bolt/bench.go') diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go index 7eb503d..a3aa9b8 100644 --- a/cmd/bolt/bench.go +++ b/cmd/bolt/bench.go @@ -46,6 +46,7 @@ func Bench(options *BenchOptions) { fatal(err) return } + db.NoSync = options.NoSync db.FillPercent = options.FillPercent defer db.Close() @@ -363,6 +364,7 @@ type BenchOptions struct { BlockProfile string StatsInterval time.Duration FillPercent float64 + NoSync bool Clean bool } -- cgit v1.2.3