From 0c8e9968a5ab9a8fdf32f2168f6a0581ca5c3a38 Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Fri, 12 Apr 2024 14:39:40 -0700 Subject: [PATCH] more benchmarks --- bench_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bench_test.go b/bench_test.go index af9e163..8afcd0d 100644 --- a/bench_test.go +++ b/bench_test.go @@ -87,6 +87,22 @@ func Benchmark_createGraph_preallocateNodes_4096(b *testing.B) { benchmarkCreateGraph(4096, true, b) } +func Benchmark_createGraph_customIdentifierProvider_4096(b *testing.B) { + b.Cleanup(func() { + SetIdentifierProvider(cryptoRandIdentifierProvider) + }) + SetIdentifierProvider(counterIdentifierProvider) + benchmarkCreateGraph(4096, false, b) +} + +func Benchmark_createGraphpreallocateNodes__customIdentifierProvider_4096(b *testing.B) { + b.Cleanup(func() { + SetIdentifierProvider(cryptoRandIdentifierProvider) + }) + SetIdentifierProvider(counterIdentifierProvider) + benchmarkCreateGraph(4096, true, b) +} + func Benchmark_createGraph_8192(b *testing.B) { benchmarkCreateGraph(8192, false, b) } @@ -95,6 +111,22 @@ func Benchmark_createGraph_preallocateNodes_8192(b *testing.B) { benchmarkCreateGraph(8192, true, b) } +func Benchmark_createGraph_customIdentifierProvider_8192(b *testing.B) { + b.Cleanup(func() { + SetIdentifierProvider(cryptoRandIdentifierProvider) + }) + SetIdentifierProvider(counterIdentifierProvider) + benchmarkCreateGraph(8192, false, b) +} + +func Benchmark_createGraphpreallocateNodes__customIdentifierProvider_8192(b *testing.B) { + b.Cleanup(func() { + SetIdentifierProvider(cryptoRandIdentifierProvider) + }) + SetIdentifierProvider(counterIdentifierProvider) + benchmarkCreateGraph(8192, true, b) +} + func Benchmark_Stabilize_withPreInitialize_512(b *testing.B) { benchmarkSize(512, b) }