Why is the murmur slower than the built-in MD5 / SHA1 method

I just tried C # hash hash port ...

However, I am very disappointed in its performance. It seems to be slower than the Cute MD5 / SHA1 computeHash built-in method.

Debug mode is OK, and noise in this mode is faster. If you switch to Release mode, it will be slower than SHA1 or MD5.

+4
source share
1 answer

I found the reason it should be installed on x64 or anycpu instead of x86

here is the test result.

Release - Target AnyCPU Murmur Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :**1.787** bytesPerSecond :1466950195.85898 mbitsPerSecond :1398.99272523783 BuildinSHA Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :**5.956** bytesPerSecond :440134318.334453 mbitsPerSecond :419.74479516454 Release - Target X86 Murmur Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :10.612 bytesPerSecond :247026008.292499 mbitsPerSecond :235.582359592914 BuildinSHA Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :5.987 bytesPerSecond :437855353.265408 mbitsPerSecond :417.571404710205 Release - Target X64 Murmur Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :1.732 bytesPerSecond :1513533487.29792 mbitsPerSecond :1443.41801385681 BuildinSHA Hash profile... test Bytes :2621440000 iterations :10000 totalSeconds :5.968 bytesPerSecond :439249329.758713 mbitsPerSecond :418.900804289544 

Jurassic Code:

https://github.com/arisoyang/Murmur3Hash

+2
source

All Articles