Skip to content

Commit

Permalink
Update benchmark result
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait authored Aug 22, 2024
1 parent f6dc748 commit 76e97ad
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,59 @@ runtime: deno 1.46.0 (x86_64-unknown-linux-gnu)
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/javascript-api.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
---------------------------------------------------------------- -----------------------------
new URL 416.13 ns/iter 2,403,099.5 (405.42 ns … 555.37 ns) 418.77 ns 484.67 ns 555.37 ns
JSON.parse 73.89 ns/iter 13,534,102.7 (63.84 ns … 103.26 ns) 78.06 ns 84.7 ns 86.2 ns
new URL 419.15 ns/iter 2,385,770.2 (408.32 ns … 529.9 ns) 422.27 ns 494.52 ns 529.9 ns
JSON.parse 74.23 ns/iter 13,471,685.9 (65.18 ns … 155.15 ns) 78.56 ns 86.24 ns 91.6 ns
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/ndk.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
--------------------------------------------------------------- -----------------------------
sign 2.35 ms/iter 425.1 (2.12 ms … 4.7 ms) 2.35 ms 4 ms 4.31 ms
isValid 1.63 ms/iter 615.0 (1.42 ms … 2.98 ms) 1.59 ms 2.8 ms 2.98 ms
benchmark time (avg) iter/s (min … max) p75 p99 p995
--------------------------------------------------------------------- -----------------------------
sign 2.29 ms/iter 437.4 (2.09 ms … 3.03 ms) 2.32 ms 2.77 ms 2.89 ms
verifySignature 1.58 ms/iter 631.1 (1.41 ms … 3.07 ms) 1.57 ms 2.65 ms 3.07 ms
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/nostr-tools.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
----------------------------------------------------------------------- -----------------------------
generateSecretKey 5.56 µs/iter 179,959.8 (5.29 µs … 7.45 µs) 5.38 µs 7.45 µs 7.45 µs
getPublicKey 220.87 µs/iter 4,527.5 (197.81 µs … 994.42 µs) 214.91 µs 456.18 µs 469.4 µs
getEventHash 12.76 µs/iter 78,376.0 (8.32 µs … 201.09 µs) 12.52 µs 47.86 µs 49.8 µs
finalizeEvent 2.22 ms/iter 451.5 (2.04 ms … 3.98 ms) 2.25 ms 2.81 ms 3.64 ms
verifyEvent 1.51 ms/iter 661.5 (1.37 ms … 3.11 ms) 1.55 ms 1.77 ms 3.11 ms
serializeEvent 2.57 µs/iter 388,500.4 (1.47 µs … 36.69 µs) 1.79 µs 24.91 µs 25.55 µs
JSON.stringify 3.14 µs/iter 318,066.2 (2.24 µs … 9.65 µs) 3.42 µs 6.26 µs 7.12 µs
JSON.parse 2.96 µs/iter 337,837.8 (1.98 µs … 7.7 µs) 3.23 µs 5.08 µs 5.1 µs
generateSecretKey 5.41 µs/iter 184,721.6 (5.32 µs … 6.24 µs) 5.39 µs 6.24 µs 6.24 µs
getPublicKey 217.22 µs/iter 4,603.6 (197.46 µs … 679.38 µs) 211.18 µs 413.02 µs 448.16 µs
getEventHash 12.49 µs/iter 80,051.2 (8.06 µs … 57.25 µs) 12.57 µs 44.96 µs 51.02 µs
finalizeEvent 2.2 ms/iter 455.0 (2.02 ms … 4.36 ms) 2.25 ms 2.6 ms 2.91 ms
verifyEvent 1.51 ms/iter 660.3 (1.36 ms … 2.72 ms) 1.54 ms 2.67 ms 2.72 ms
serializeEvent 2.5 µs/iter 399,361.0 (1.49 µs … 43.06 µs) 1.81 µs 25.53 µs 33.59 µs
JSON.stringify 3.17 µs/iter 315,357.9 (2.33 µs … 5.59 µs) 3.53 µs 5.47 µs 5.53 µs
JSON.parse 3.23 µs/iter 309,214.6 (2.11 µs … 17.26 µs) 3.54 µs 5.64 µs 6.01 µs
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/nostr-wasm.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
----------------------------------------------------------------------- -----------------------------
initNostrWasm 4.31 ms/iter 232.2 (3.68 ms … 6.81 ms) 4.8 ms 6.47 ms 6.81 ms
generateSecretKey 5.58 µs/iter 179,211.5 (4.12 µs … 9.59 µs) 6.1 µs 9.34 µs 9.59 µs
getPublicKey 266.94 µs/iter 3,746.2 (247.38 µs … 460.02 µs) 252.88 µs 455.73 µs 460.02 µs
finalizeEvent 547.55 µs/iter 1,826.3 (506.24 µs … 948.48 µs) 520.24 µs 937.92 µs 948.48 µs
verifyEvent 436.92 µs/iter 2,288.8 (404.02 µs … 672.07 µs) 427.78 µs 630.89 µs 672.07 µs
initNostrWasm 5.25 ms/iter 190.4 (3.75 ms … 8.47 ms) 6.43 ms 8.46 ms 8.47 ms
generateSecretKey 5.41 µs/iter 184,911.2 (4.14 µs … 11.87 µs) 5.66 µs 9.56 µs 11.87 µs
getPublicKey 280.31 µs/iter 3,567.5 (247.83 µs … 504.9 µs) 255.97 µs 501.89 µs 504.9 µs
finalizeEvent 547.27 µs/iter 1,827.2 (505.12 µs … 943.38 µs) 517.83 µs 938.01 µs 943.38 µs
verifyEvent 438.35 µs/iter 2,281.3 (404.12 µs … 680.78 µs) 430.05 µs 657.13 µs 680.78 µs
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/rust-nostr.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
------------------------------------------------------------------- -----------------------------
loadWasmAsync 171 ns/iter 5,847,953.2 (140 ns … 1.79 ms) 160 ns 360 ns 672 ns
generate 283.38 µs/iter 3,528.9 (275.54 µs … 900.06 µs) 278.96 µs 531.45 µs 548.63 µs
toEvent 171.82 µs/iter 5,820.0 (160.67 µs … 661.56 µs) 168.75 µs 330.58 µs 344.53 µs
verify 298.32 µs/iter 3,352.1 (276.76 µs … 640.46 µs) 296.87 µs 503.39 µs 548.33 µs
loadWasmAsync 164 ns/iter 6,097,561.0 (130 ns … 2.45 ms) 151 ns 351 ns 491 ns
generate 284.06 µs/iter 3,520.3 (275.99 µs … 874.38 µs) 279.17 µs 531.02 µs 551.49 µs
toEvent 171.4 µs/iter 5,834.2 (159.82 µs … 692.12 µs) 168.66 µs 336.07 µs 350.83 µs
verify 306.11 µs/iter 3,266.8 (277.64 µs … 704.53 µs) 297.59 µs 552.23 µs 590.85 µs
file:///home/runner/work/nostr-library-benchmarks/nostr-library-benchmarks/rx-nostr-crypto.bench.ts
benchmark time (avg) iter/s (min … max) p75 p99 p995
------------------------------------------------------------------------------- -----------------------------
getPublicKey 210.99 µs/iter 4,739.5 (193.14 µs … 756.36 µs) 205.6 µs 393.31 µs 430.62 µs
getEventHash 10.05 µs/iter 99,472.8 (6.9 µs … 144.29 µs) 10.62 µs 24.46 µs 27.91 µs
getSignature 1.9 ms/iter 525.3 (1.77 ms … 3.41 ms) 1.95 ms 2.13 ms 2.26 ms
seckeySigner 205.32 µs/iter 4,870.4 (190.73 µs … 527.39 µs) 201.18 µs 345.97 µs 371.95 µs
seckeySigner.getPublicKey 637 ns/iter 1,569,858.7 (340 ns … 120.36 µs) 661 ns 2.18 µs 2.29 µs
seckeySigner.signEvent 1.88 ms/iter 531.0 (1.74 ms … 2.26 ms) 1.91 ms 2.12 ms 2.24 ms
verify 1.45 ms/iter 691.0 (1.32 ms … 1.72 ms) 1.47 ms 1.69 ms 1.72 ms
getPublicKey 217.01 µs/iter 4,608.0 (194.3 µs … 944.92 µs) 207.19 µs 449.06 µs 478.66 µs
getEventHash 10.01 µs/iter 99,920.1 (6.66 µs … 102.91 µs) 10.62 µs 25.66 µs 32.71 µs
getSignature 1.93 ms/iter 517.6 (1.77 ms … 3.52 ms) 1.95 ms 3.23 ms 3.32 ms
seckeySigner 204.63 µs/iter 4,886.7 (189.38 µs … 539.35 µs) 201.66 µs 316.84 µs 374.39 µs
seckeySigner.getPublicKey 594 ns/iter 1,683,501.7 (331 ns … 7.69 µs) 621 ns 2.29 µs 2.44 µs
seckeySigner.signEvent 1.9 ms/iter 525.8 (1.77 ms … 2.56 ms) 1.92 ms 2.41 ms 2.43 ms
verify 1.46 ms/iter 685.2 (1.36 ms … 1.63 ms) 1.48 ms 1.62 ms 1.63 ms
```

### Go
Expand Down

0 comments on commit 76e97ad

Please sign in to comment.