From 71e91e24b064c1c8e33d92b7f324b6cd57d07f87 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Mon, 14 Apr 2014 16:25:04 +0000 Subject: [PATCH] move bench package to bench/cmd/bolt/bench --- {bench => cmd/bolt/bench}/bench.go | 0 {bench => cmd/bolt/bench}/config.go | 0 {bench => cmd/bolt/bench}/generate.go | 0 tx_test.go | 192 +++++++++++++------------- 4 files changed, 96 insertions(+), 96 deletions(-) rename {bench => cmd/bolt/bench}/bench.go (100%) rename {bench => cmd/bolt/bench}/config.go (100%) rename {bench => cmd/bolt/bench}/generate.go (100%) diff --git a/bench/bench.go b/cmd/bolt/bench/bench.go similarity index 100% rename from bench/bench.go rename to cmd/bolt/bench/bench.go diff --git a/bench/config.go b/cmd/bolt/bench/config.go similarity index 100% rename from bench/config.go rename to cmd/bolt/bench/config.go diff --git a/bench/generate.go b/cmd/bolt/bench/generate.go similarity index 100% rename from bench/generate.go rename to cmd/bolt/bench/generate.go diff --git a/tx_test.go b/tx_test.go index 61810d3..178d5aa 100644 --- a/tx_test.go +++ b/tx_test.go @@ -267,110 +267,110 @@ func TestTx_OnCommit_Rollback(t *testing.T) { assert.Equal(t, 0, x) } -func BenchmarkReadSequential_1Concurrency_1Buckets_1Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1, 1) -} -func BenchmarkReadSequential_1Concurrency_1Buckets_10Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10, 1) -} -func BenchmarkReadSequential_1Concurrency_1Buckets_100Items(b *testing.B) { - benchmarkReadSequential(b, 1, 100, 1) -} -func BenchmarkReadSequential_1Concurrency_1Buckets_1000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1000, 1) -} -func BenchmarkReadSequential_1Concurrency_1Buckets_10000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10000, 1) -} +// func BenchmarkReadSequential_1Concurrency_1Buckets_1Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1, 1) +// } +// func BenchmarkReadSequential_1Concurrency_1Buckets_10Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10, 1) +// } +// func BenchmarkReadSequential_1Concurrency_1Buckets_100Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 100, 1) +// } +// func BenchmarkReadSequential_1Concurrency_1Buckets_1000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1000, 1) +// } +// func BenchmarkReadSequential_1Concurrency_1Buckets_10000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10000, 1) +// } -func BenchmarkReadSequential_10Concurrency_1Buckets_1Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1, 10) -} -func BenchmarkReadSequential_10Concurrency_1Buckets_10Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10, 10) -} -func BenchmarkReadSequential_10Concurrency_1Buckets_100Items(b *testing.B) { - benchmarkReadSequential(b, 1, 100, 10) -} -func BenchmarkReadSequential_10Concurrency_1Buckets_1000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1000, 10) -} -func BenchmarkReadSequential_10Concurrency_1Buckets_10000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10000, 10) -} +// func BenchmarkReadSequential_10Concurrency_1Buckets_1Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1, 10) +// } +// func BenchmarkReadSequential_10Concurrency_1Buckets_10Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10, 10) +// } +// func BenchmarkReadSequential_10Concurrency_1Buckets_100Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 100, 10) +// } +// func BenchmarkReadSequential_10Concurrency_1Buckets_1000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1000, 10) +// } +// func BenchmarkReadSequential_10Concurrency_1Buckets_10000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10000, 10) +// } -func BenchmarkReadSequential_100Concurrency_1Buckets_1Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1, 100) -} -func BenchmarkReadSequential_100Concurrency_1Buckets_10Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10, 100) -} -func BenchmarkReadSequential_100Concurrency_1Buckets_100Items(b *testing.B) { - benchmarkReadSequential(b, 1, 100, 100) -} -func BenchmarkReadSequential_100Concurrency_1Buckets_1000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1000, 100) -} -func BenchmarkReadSequential_100Concurrency_1Buckets_10000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10000, 100) -} +// func BenchmarkReadSequential_100Concurrency_1Buckets_1Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1, 100) +// } +// func BenchmarkReadSequential_100Concurrency_1Buckets_10Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10, 100) +// } +// func BenchmarkReadSequential_100Concurrency_1Buckets_100Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 100, 100) +// } +// func BenchmarkReadSequential_100Concurrency_1Buckets_1000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1000, 100) +// } +// func BenchmarkReadSequential_100Concurrency_1Buckets_10000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10000, 100) +// } -func BenchmarkReadSequential_1000Concurrency_1Buckets_1Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1, 1000) -} -func BenchmarkReadSequential_1000Concurrency_1Buckets_10Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10, 1000) -} -func BenchmarkReadSequential_1000Concurrency_1Buckets_100Items(b *testing.B) { - benchmarkReadSequential(b, 1, 100, 1000) -} -func BenchmarkReadSequential_1000Concurrency_1Buckets_1000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1000, 1000) -} -func BenchmarkReadSequential_1000Concurrency_1Buckets_10000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10000, 1000) -} +// func BenchmarkReadSequential_1000Concurrency_1Buckets_1Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1, 1000) +// } +// func BenchmarkReadSequential_1000Concurrency_1Buckets_10Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10, 1000) +// } +// func BenchmarkReadSequential_1000Concurrency_1Buckets_100Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 100, 1000) +// } +// func BenchmarkReadSequential_1000Concurrency_1Buckets_1000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1000, 1000) +// } +// func BenchmarkReadSequential_1000Concurrency_1Buckets_10000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10000, 1000) +// } -func BenchmarkReadSequential_10000Concurrency_1Buckets_1Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1, 10000) -} -func BenchmarkReadSequential_10000Concurrency_1Buckets_10Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10, 10000) -} -func BenchmarkReadSequential_10000Concurrency_1Buckets_100Items(b *testing.B) { - benchmarkReadSequential(b, 1, 100, 10000) -} -func BenchmarkReadSequential_10000Concurrency_1Buckets_1000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 1000, 10000) -} -func BenchmarkReadSequential_10000Concurrency_1Buckets_10000Items(b *testing.B) { - benchmarkReadSequential(b, 1, 10000, 10000) -} +// func BenchmarkReadSequential_10000Concurrency_1Buckets_1Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1, 10000) +// } +// func BenchmarkReadSequential_10000Concurrency_1Buckets_10Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10, 10000) +// } +// func BenchmarkReadSequential_10000Concurrency_1Buckets_100Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 100, 10000) +// } +// func BenchmarkReadSequential_10000Concurrency_1Buckets_1000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 1000, 10000) +// } +// func BenchmarkReadSequential_10000Concurrency_1Buckets_10000Items(b *testing.B) { +// benchmarkReadSequential(b, 1, 10000, 10000) +// } -func benchmark(b *testing.B, readWriteMode, traversalPattern string, numBuckets, numItemsPerBucket, parallelism int) { - withOpenDB(func(db *DB, path string) { - if err := bench.GenerateDB(db, numBuckets, numItemsPerBucket); err != nil { - b.Fatal(err) - } - bench.New(db, &bench.Config{ - ReadWriteMode: readWriteMode, - TraversalPattern: traversalPattern, - Parallelism: parallelism, - }).Run(b) - }) -} +// func benchmark(b *testing.B, readWriteMode, traversalPattern string, numBuckets, numItemsPerBucket, parallelism int) { +// withOpenDB(func(db *DB, path string) { +// if err := bench.GenerateDB(db, numBuckets, numItemsPerBucket); err != nil { +// b.Fatal(err) +// } +// bench.New(db, &bench.Config{ +// ReadWriteMode: readWriteMode, +// TraversalPattern: traversalPattern, +// Parallelism: parallelism, +// }).Run(b) +// }) +// } -func benchmarkRead(b *testing.B, traversalPattern string, numBuckets, numItemsPerBucket, parallelism int) { - benchmark(b, bench.BenchReadMode, traversalPattern, numBuckets, numItemsPerBucket, parallelism) -} +// func benchmarkRead(b *testing.B, traversalPattern string, numBuckets, numItemsPerBucket, parallelism int) { +// benchmark(b, bench.BenchReadMode, traversalPattern, numBuckets, numItemsPerBucket, parallelism) +// } -func benchmarkReadSequential(b *testing.B, numBuckets, numItemsPerBucket, parallelism int) { - benchmark(b, bench.BenchReadMode, bench.BenchSequentialTraversal, numBuckets, numItemsPerBucket, parallelism) -} +// func benchmarkReadSequential(b *testing.B, numBuckets, numItemsPerBucket, parallelism int) { +// benchmark(b, bench.BenchReadMode, bench.BenchSequentialTraversal, numBuckets, numItemsPerBucket, parallelism) +// } -func benchmarkReadRandom(b *testing.B, numBuckets, numItemsPerBucket, parallelism int) { - benchmark(b, bench.BenchReadMode, bench.BenchRandomTraversal, numBuckets, numItemsPerBucket, parallelism) -} +// func benchmarkReadRandom(b *testing.B, numBuckets, numItemsPerBucket, parallelism int) { +// benchmark(b, bench.BenchReadMode, bench.BenchRandomTraversal, numBuckets, numItemsPerBucket, parallelism) +// } // Benchmark the performance iterating over a cursor. func BenchmarkTxCursor1(b *testing.B) { benchmarkTxCursor(b, 1) }