grunch/rana

`Avg. rate` stats inconsistent

ok300 opened this issue · 1 comments

ok300 commented

I did a test run and got

Started mining process with a difficulty of: 10
Benchmarking a single core for 5 seconds...
A single core can mine roughly 20904 h/s!
Searching for prefix of 10 zero bits
This is estimated to take about 0.00612323 seconds
Mining using 8 cores...
==============================================
Found matching public key: 000ababa0f00221db06d93de44d083cad32e3456e938424b0f934b8d288ac963
Leading zero bits: 12
365 iterations (about 3x10^2 hashes) in 0 seconds. Avg rate 16590 hashes/second
Nostr private key: 09e5cefafa65da27c15cc91fdc63d4879494f4096f1404ca33f2a32ac51baf03
==============================================
Found matching public key: 00053b5d9378f2de342f42269b76108078214072b24ba329f5244f5da589594f
Leading zero bits: 13
2012 iterations (about 2x10^3 hashes) in 0 seconds. Avg rate 16491 hashes/second
Nostr private key: e1cdbb344d99f0e293f93127c6e3eaf8f059f46532cab62953bf986c0d3b6437
==============================================
Found matching public key: 00011964a047969405f12e9108f6c54d119903f4fcd248d54d9a07bae0295eff
Leading zero bits: 15
6729 iterations (about 6x10^3 hashes) in 0 seconds. Avg rate 16533 hashes/second
Nostr private key: 7c2209291010083548bf9ae25bb2b6fbbe5fd8dd755a7f555bee594929f3c346
==============================================
Found matching public key: 00001b461dbf01de2efc44f12b70bdb528aa163db6a7712ccb9c52c0be97c636
Leading zero bits: 19
12143 iterations (about 1x10^4 hashes) in 0 seconds. Avg rate 16365 hashes/second
Nostr private key: 74e70eb2b42ffa50cf0a2e2badd94b418d2b05a26d7b37c52676f7590eea5005
==============================================
Found matching public key: 00000d79d673013b71f38d3483f4f2c5a6c5b7cc853347489ca031e6e3c5e0af
Leading zero bits: 20
53647 iterations (about 5x10^4 hashes) in 3 seconds. Avg rate 16476 hashes/second
Nostr private key: 175111e1142d752eac20c9520a00cafc9babbdf30e4e116c57bcdfae403ec84e
==============================================
Found matching public key: 000003e8edf47c7f80bfc5ec19f3f7372909e19070b1b19bf1d44b13444405ab
Leading zero bits: 22
116162 iterations (about 1x10^5 hashes) in 7 seconds. Avg rate 16472 hashes/second
Nostr private key: 1ce6dd2d8ce17069ba823f060ea50468a175a59dd24914860f627b33f8b417e2
==============================================
Found matching public key: 00000054818d28f99e54b65b2a33be471f17ca1a5dcb14b1a7d92c48eec3641a
Leading zero bits: 25
1586030 iterations (about 1x10^6 hashes) in 102 seconds. Avg rate 15406 hashes/second
Nostr private key: 2d15c21220c07d610cd64af6adb0fe332a7504f8ad56c0853b0c8574a30f1860

Every pubkey found (difficulty 12 - 25) shows avg. rate of about 15-16k hashes/second.

At the top, the benchmark results show a single core can do ~20k h/s.

Yet while it was running and generating those keys, I could see load on all my CPUs (so indeed more than 1 core was used).

So if its using multiple cores, why is the resulting hash rate similar to a single core?

Didn't look at the code yet, but I assume only the iterations of one core (the one that found the key) are counted?

ok300 commented

Not an issue anymore after #5 was merged.