]> zoso.dev Git - libnemo.git/commitdiff
Save some benchmarking notes.
authorChris Duncan <chris@zoso.dev>
Sun, 5 Jan 2025 05:55:19 +0000 (21:55 -0800)
committerChris Duncan <chris@zoso.dev>
Sun, 5 Jan 2025 05:55:19 +0000 (21:55 -0800)
src/lib/workers/benchmarks.md [new file with mode: 0644]

diff --git a/src/lib/workers/benchmarks.md b/src/lib/workers/benchmarks.md
new file mode 100644 (file)
index 0000000..c6fd372
--- /dev/null
@@ -0,0 +1,29 @@
+Total: 89756 ms block.perf.js:76:10
+Average: 5609.75 ms block.perf.js:77:10
+Harmonic: 2092.567565254879 ms block.perf.js:78:10
+Geometric: 3612.112662613675 ms block.perf.js:79:10
+PASS  Original PoW module: Time to calculate proof-of-work for a send block 16 times
+
+
+Total: 33240 ms block.perf.js:57:10
+Average: 2077.5 ms block.perf.js:58:10
+Harmonic: 1328.5635414262717 ms block.perf.js:59:10
+Geometric: 1663.110986923899 ms block.perf.js:60:10
+PASS  Customized PoW: Time to calculate proof-of-work for a send block 16 times
+
+How much faster?
+Total:    56156 ms
+Average:   3532 ms
+Harmonic:   764 ms
+Geometric: 1949 ms
+
+The proof-of-work equation for Nano cryptocurrency is defined as `blake2b(nonce||blockhash)>=threshold` where blake2b is the hash function configured for an 8-byte output, nonce is a random 8-byte value, || is concatenation, blockhash is a 32-byte value, and threshold is 0xfffffff800000000.
+
+My code currently finds valid nonces on a gaming GPU without issue but only because the initial search space is so large due to using a workgroup size of 256 and a dispatch of (256, 256, 256), so the probability of finding a nonce in the first pass is extremely high. However, this does not perform well on less powerful hardware like smartphones. Please alter my code to perform the nonce search in `main()` in a loop until a valid nonce is found with the idea that a smaller workgroup size and/or smaller dispatch dimensions can allow weak hardware to nonetheless iterate through nonces to search for a valid one and return it.
+
+
+Total: 680948 ms block.perf.js:56:10
+Average: 1329.9765625 ms block.perf.js:57:10
+Harmonic: 749.6552658409396 ms block.perf.js:58:10
+Geometric: Infinity ms block.perf.js:59:10
+PASS  Customized PoW: Time to calculate proof-of-work for a send block 512 times