Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-08

xxHash

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vojtěch Čihák

Hi,
 
I ported to freepascal xxHash, very fast non-cryptographic algorithm, working near the RAM limits. Originally, it is written in C and published under the BSD license. 
 
Original C: https://code.google.com/p/xxhash/ 
 
Pascal port: http://sourceforge.net/projects/xxhashfpc/files/   
Currently both 32-bit and 64-bit hashing works but only little-endian. Big-endian is not implemented.
 
Only issue is the performance. While 64-bit hashing is good:  
FPC: 3200 MB/s  vs. GCC 3440 MB/s (it is 93%)
 
the 32-bit speed is much worst.
 
GCC benchmark has two results:
 
unaligned 2800 MB/s
aligned 3330 MB/s (buffer is aligned to 16B)
 
FPC gives 2200 MB/s and aligning buffer to 16, 32, or more bytes has no effect.  
It is 79% of unaligned or 66% of aligned GCC result.  
If someone want to help with improving performance or implement big-endian version, he can contact me here on ML or on forum (nick Blaazen).   I can give him username and password to sourgeforge eventually.  
For curiosity, there exists also blog where author optimalized algorithm via SSE instructions. http://moinakg.wordpress.com/2013/01/19/vectorizing-xxhash-for-fun-and-profit/  
Vojtěch a.k.a. Blaazen 

Reply by email