summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/beorn7/perks/histogram/bench_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/beorn7/perks/histogram/bench_test.go')
-rw-r--r--vendor/github.com/beorn7/perks/histogram/bench_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/beorn7/perks/histogram/bench_test.go b/vendor/github.com/beorn7/perks/histogram/bench_test.go
new file mode 100644
index 000000000..56c7e5516
--- /dev/null
+++ b/vendor/github.com/beorn7/perks/histogram/bench_test.go
@@ -0,0 +1,26 @@
+package histogram
+
+import (
+ "math/rand"
+ "testing"
+)
+
+func BenchmarkInsert10Bins(b *testing.B) {
+ b.StopTimer()
+ h := New(10)
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ f := rand.ExpFloat64()
+ h.Insert(f)
+ }
+}
+
+func BenchmarkInsert100Bins(b *testing.B) {
+ b.StopTimer()
+ h := New(100)
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ f := rand.ExpFloat64()
+ h.Insert(f)
+ }
+}