Closed hsk81 closed 1 year ago
How much faster it is?
Maybe 10%
On Tue, Oct 24, 2023, 21:26 Dani Biró @.***> wrote:
How much faster it is?
— Reply to this email directly, view it on GitHub https://github.com/Daninet/hash-wasm/pull/52#issuecomment-1777796885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHYHBOBW674J2X3IZTJTXTYBAB7BAVCNFSM6AAAAAA6N75U7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZXG44TMOBYGU . You are receiving this because you authored the thread.Message ID: @.***>
The
Hash_Calculate
WASM function seems to be faster, because of less of an overhead due to fewer context switches. Hence, I've exposed it as theIHasher.calculate
function:It's optional, since I was too lazy to implement it for all hashing functions, except for
keccak
. Further, it returns based on theoutputType
the actual hasher function to avoid an if-switch on the "hot" path during frequent hashing. For example: