PPC64 / hhvm

A virtual machine designed for executing programs written in Hack and PHP.
http://hhvm.com
Other
4 stars 3 forks source link

Integrate P8 CRC32 for hash #140

Closed daxtens closed 8 years ago

daxtens commented 8 years ago

hphp/util/hash-crc.S and friends use a crc32 based hash on intel but fall back to murmur3 on Power. Murmur 3 is really not friendly to us, and we have an accelerated crc32 we could integrate.

Anton Blanchard has an accelerated CRC32 for Power8: https://github.com/antonblanchard/crc32-vpmsum

The big complication is that there's both case sensitive and case insensitive hashes - for case insensitive, 0xdf is anded with each byte to drop things to lowercase. That'll need some work to do with Anton's code.

daxtens commented 8 years ago

On further investigation, it looks like the average hash size is short, so maybe this isn't what we want to do just yet.

daxtens commented 8 years ago

On Wordpress, the average length of a case sensitive hash was ~3 while running and a bit higher while building, and a case insensitive hash was ~20 while running.

The accelerated CRC, being VMX based, is of no use until the length is > 32, so we probably don't want to do this.