summaryrefslogtreecommitdiffstats
path: root/benchmarks/comparison/README.md
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-16 10:58:11 -0800
committerbndw <ben@bdw.to>2026-02-16 10:58:11 -0800
commit4b7dfe1e7764d8424b1be935c7fea09a102382e8 (patch)
treebd80dc38b0c3d9e4332b9f5df25c17fb4943ea64 /benchmarks/comparison/README.md
parent7a5d5a53e5d6878f38382c4d35f644e088d318d2 (diff)
fix: cleanup bench
Diffstat (limited to 'benchmarks/comparison/README.md')
-rw-r--r--benchmarks/comparison/README.md44
1 files changed, 44 insertions, 0 deletions
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 @@
1# Nostr Library Comparison Benchmarks
2
3This module contains benchmarks comparing `code.northwest.io/nostr` with other popular Go Nostr libraries:
4
5- **NWIO** (`code.northwest.io/nostr`) - This library
6- **NBD** (`github.com/nbd-wtf/go-nostr`) - Popular community library
7- **Fiat** (`fiatjaf.com/nostr`) - Original implementation by Fiatjaf
8
9## Why a Separate Module?
10
11The 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.
12
13## Running Benchmarks
14
15From this directory:
16
17```bash
18# Run all comparison benchmarks
19go test -bench=. -benchmem
20
21# Run specific benchmarks
22go test -bench=BenchmarkEventSign -benchmem
23
24# Compare NWIO vs NBD
25go test -bench='.*_(NWIO|NBD)' -benchmem
26```
27
28From the project root:
29
30```bash
31cd benchmarks/comparison
32go test -bench=. -benchmem
33```
34
35## Benchmark Categories
36
37- **Event Unmarshaling/Marshaling**: JSON parsing and serialization
38- **Event Serialization**: Canonical serialization for ID computation
39- **Event ID Computation**: Computing event ID hashes
40- **Key Generation**: Generating new private keys
41- **Event Signing/Verification**: Cryptographic operations
42- **Filter Matching**: Simple and complex filter matching
43
44See [../../BENCHMARKS.md](../../BENCHMARKS.md) for detailed documentation.