commit | 0c488d05a018201db79f1aa4508e3e1ce6328da1 | [log] [tgz] |
---|---|---|
author | Oliver, Jonathan <git@jonathanoliver.com> | Fri May 30 16:59:29 2014 -0600 |
committer | Oliver, Jonathan <git@jonathanoliver.com> | Fri May 30 16:59:29 2014 -0600 |
tree | 19780d5c67c3f4f5aa8d280eebd60b0f1d949805 | |
parent | 0d9a09f73de69d4747479a5f663d665caf969da5 [diff] |
Added writer benchmark.
diff --git a/writer_test.go b/writer_test.go new file mode 100644 index 0000000..06b00a2 --- /dev/null +++ b/writer_test.go
@@ -0,0 +1,17 @@ +package disruptor + +import "testing" + +func BenchmarkWriterReserve(b *testing.B) { + iterations := int64(b.N) + written, read := NewCursor(), NewCursor() + writer := NewWriter(written, read, 1024*64) + + b.ReportAllocs() + b.ResetTimer() + + for i := int64(0); i < iterations; i++ { + writer.Reserve() + read.Sequence = i + } +}