# 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.