From 7a5d5a53e5d6878f38382c4d35f644e088d318d2 Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 14 Feb 2026 18:56:19 -0800 Subject: feat: add library comparison benchmarks with build tag isolation Add comprehensive benchmarks comparing NWIO against nbd-wtf/go-nostr and fiatjaf.com/nostr across event operations, signing, verification, and filtering. Use build tag 'benchcmp' to prevent competitor libraries from polluting module dependencies - they're only downloaded when explicitly running comparison tests. --- benchmark_results.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 benchmark_results.txt (limited to 'benchmark_results.txt') diff --git a/benchmark_results.txt b/benchmark_results.txt new file mode 100644 index 0000000..c3976e6 --- /dev/null +++ b/benchmark_results.txt @@ -0,0 +1,32 @@ +goos: linux +goarch: amd64 +cpu: AMD Ryzen AI 9 HX PRO 370 w/ Radeon 890M +BenchmarkEventUnmarshal_NWIO-24 498826 2541 ns/op 888 B/op 17 allocs/op +BenchmarkEventUnmarshal_NBD-24 423019 2832 ns/op 944 B/op 13 allocs/op +BenchmarkEventUnmarshal_Fiat-24 430042 2545 ns/op 752 B/op 10 allocs/op +BenchmarkEventMarshal_NWIO-24 613165 1790 ns/op 1010 B/op 3 allocs/op +BenchmarkEventMarshal_NBD-24 620986 1819 ns/op 1500 B/op 6 allocs/op +BenchmarkEventMarshal_Fiat-24 621964 1971 ns/op 2254 B/op 13 allocs/op +BenchmarkEventSerialize_NWIO-24 3059661 391.0 ns/op 360 B/op 7 allocs/op +BenchmarkEventSerialize_NBD-24 8824029 128.8 ns/op 208 B/op 2 allocs/op +BenchmarkEventSerialize_Fiat-24 6533536 160.9 ns/op 400 B/op 3 allocs/op +BenchmarkComputeID_NWIO-24 2108437 608.0 ns/op 488 B/op 9 allocs/op +BenchmarkComputeID_NBD-24 4072243 302.2 ns/op 336 B/op 4 allocs/op +BenchmarkComputeID_Fiat-24 4421660 275.9 ns/op 400 B/op 3 allocs/op +BenchmarkGenerateKey_NWIO-24 31942 37689 ns/op 208 B/op 4 allocs/op +BenchmarkGenerateKey_NBD-24 2489169 469.6 ns/op 369 B/op 8 allocs/op +BenchmarkGenerateKey_Fiat-24 45475 25375 ns/op 272 B/op 5 allocs/op +BenchmarkEventSign_NWIO-24 9072 129854 ns/op 2363 B/op 42 allocs/op +BenchmarkEventSign_NBD-24 20325 59069 ns/op 2112 B/op 35 allocs/op +BenchmarkEventSign_Fiat-24 20613 58572 ns/op 1760 B/op 29 allocs/op +BenchmarkEventVerify_NWIO-24 12009 99744 ns/op 953 B/op 19 allocs/op +BenchmarkEventVerify_NBD-24 10000 105995 ns/op 624 B/op 11 allocs/op +BenchmarkEventVerify_Fiat-24 10000 103744 ns/op 640 B/op 9 allocs/op +BenchmarkFilterMatch_NWIO-24 167376669 7.091 ns/op 0 B/op 0 allocs/op +BenchmarkFilterMatch_NBD-24 100000000 10.82 ns/op 0 B/op 0 allocs/op +BenchmarkFilterMatch_Fiat-24 71761591 16.40 ns/op 0 B/op 0 allocs/op +BenchmarkFilterMatchComplex_NWIO-24 39214178 30.88 ns/op 0 B/op 0 allocs/op +BenchmarkFilterMatchComplex_NBD-24 35580048 33.40 ns/op 0 B/op 0 allocs/op +BenchmarkFilterMatchComplex_Fiat-24 28026481 42.64 ns/op 0 B/op 0 allocs/op +PASS +ok command-line-arguments 40.651s -- cgit v1.2.3