From 4b7dfe1e7764d8424b1be935c7fea09a102382e8 Mon Sep 17 00:00:00 2001 From: bndw Date: Mon, 16 Feb 2026 10:58:11 -0800 Subject: fix: cleanup bench --- benchmarks/comparison/README.md | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 benchmarks/comparison/README.md (limited to 'benchmarks/comparison/README.md') diff --git a/benchmarks/comparison/README.md b/benchmarks/comparison/README.md new file mode 100644 index 0000000..1b97429 --- /dev/null +++ b/benchmarks/comparison/README.md @@ -0,0 +1,44 @@ +# Nostr Library Comparison Benchmarks + +This module contains benchmarks comparing `code.northwest.io/nostr` with other popular Go Nostr libraries: + +- **NWIO** (`code.northwest.io/nostr`) - This library +- **NBD** (`github.com/nbd-wtf/go-nostr`) - Popular community library +- **Fiat** (`fiatjaf.com/nostr`) - Original implementation by Fiatjaf + +## Why a Separate Module? + +The comparison libraries are isolated in this separate Go module to keep the main `code.northwest.io/nostr` package clean. Users who import the main package won't have `fiatjaf.com/nostr` or `github.com/nbd-wtf/go-nostr` pulled into their dependency tree. + +## Running Benchmarks + +From this directory: + +```bash +# Run all comparison benchmarks +go test -bench=. -benchmem + +# Run specific benchmarks +go test -bench=BenchmarkEventSign -benchmem + +# Compare NWIO vs NBD +go test -bench='.*_(NWIO|NBD)' -benchmem +``` + +From the project root: + +```bash +cd benchmarks/comparison +go test -bench=. -benchmem +``` + +## Benchmark Categories + +- **Event Unmarshaling/Marshaling**: JSON parsing and serialization +- **Event Serialization**: Canonical serialization for ID computation +- **Event ID Computation**: Computing event ID hashes +- **Key Generation**: Generating new private keys +- **Event Signing/Verification**: Cryptographic operations +- **Filter Matching**: Simple and complex filter matching + +See [../../BENCHMARKS.md](../../BENCHMARKS.md) for detailed documentation. -- cgit v1.2.3