-
Notifications
You must be signed in to change notification settings - Fork 370
Use xxHash instead of SHA-256 on incoming transaction hashes cache #1326
Use xxHash instead of SHA-256 on incoming transaction hashes cache #1326
Conversation
Nice one! :) |
03b53c4
to
f06ba33
Compare
I only made some benchmarks in golang, sorry. But here are my results for golang:
229ns vs 10.4ns on my machine This is called more often than Curl, depending on the amount of neighbors you have. |
After 1.6.1 will be out we will check if this should be merged |
Here a quick benchmark between SHA-256 and two xxHash libs (LZ4 and Zero-Allocation-Hashing) hashing the same million of 1653-byte arrays. The PR implements the last one. Please note the
That means a 5-neighbors node at 100 TPS would only save about 1 second every 5 minutes. |
At higher rate this makes more impact
Thats already a difference of 10.56s every 5 Minutes with 1000 TPS and 5 neighbors (28.4 % CPU load). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
I want to finish #1328 first so that we can track the overall improvement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gg
Description
Use xxHash instead of SHA-256 on incoming transaction hashes cache to reduce CPU load and allows higher TPS throughput.
Fixes #1171
Type of change
Checklist: