Skip to content

Commit

Permalink
binary decoding performance gains are negligible.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Nov 4, 2023
1 parent 2fd7c22 commit 0ecffe6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Some benchmarks:

```
goos: linux
goarch: amd64
pkg: github.com/nbd-wtf/go-nostr/binary
Expand All @@ -16,3 +17,8 @@ BenchmarkBinaryDecoding/easyjson.Unmarshal+sig-4 307 39719
BenchmarkBinaryDecoding/binary.Unmarshal+sig-4 310 3924042 ns/op 111277 B/op 421 allocs/op
PASS
ok github.com/nbd-wtf/go-nostr/binary 11.444s
```

This is 2~5x faster than [NSON](../nson) decoding, which means 8x faster than default easyjson decoding,
but, just like NSON, the performance gains from this encoding is negligible when you add the cost of
signature verification. Which means this encoding must only be used in internal processes.

0 comments on commit 0ecffe6

Please sign in to comment.