Closed p5pRT closed 4 years ago
summary: SIPHASH on 32 bit processors without native CPU 64 bit integers (such as 32 bit x86) is atleast an order of magnitude slower than one at a time hash
The discussion in http://www.nntp.perl.org/group/perl.perl5.porters/2012/12/msg196172.html about commit 3db6cbfca39da94d152d3e860e2aa79b9c6bb16 "Switch default hash to SIPHASH on 64 bit builds and ONE_AT_A_TIME on 32 bit builds" seems to have flickered out. I feel its time for the issue to be a bug report and not a ML discussion so its not forgotten. I don't think Configure has a way of figuring out what is the largest native CPU integral type\, and I am not sure if there are any GCC or partially portable macros that can be tested to learn the CPU type or learn if a particular compiler O level has native 64 bit ints or not. IDK if any other FOSS project has a framework for figuring these things out (I imagine a large hand edited header file would work if there are enough maintainers with enough CPUs and compilers/platforms\, for example take something out of GCC's code base where I'm sure (guess) all this info exists). As the next best thing\, instead of checking for U64 type/macro\, maybe check if sizeof(void *) == 8 and U64\, only then use SIPHASH\, but that is bias towards traditional x86 and doesn't cover clever tricks like http://en.wikipedia.org/wiki/X32_ABI (where SIPHASH should be picked even though sizeof(void *) == 4) or the equivalent on other CPUs.
My current branch checks if HAS_QUAD is defined.
Yves
The RT System itself - Status changed from 'new' to 'open'
On Tue Dec 11 18:19:54 2012\, bulk88 wrote:
This is a bug report for perl from bulk88@hotmail.com\, generated with the help of perlbug 1.39 running under perl 5.17.7.
----------------------------------------------------------------- [Please describe your issue here]
summary: SIPHASH on 32 bit processors without native CPU 64 bit integers (such as 32 bit x86) is atleast an order of magnitude slower than one at a time hash
See attached patch. I tried it on VC 2003 32 bit Win32 Perl\, no Quads\, and on VC 2003 32 bit Win32 Perl\, with Quads. Asm showed one_at_a_time being used on the with Quads Perl. I didn't do a make test on the Perls for this patch.
-- bulk88 ~ bulk88 at hotmail.com
On Sun Dec 23 00:09:52 2012\, bulk88 wrote:
On Tue Dec 11 18:19:54 2012\, bulk88 wrote:
This is a bug report for perl from bulk88@hotmail.com\, generated with the help of perlbug 1.39 running under perl 5.17.7.
----------------------------------------------------------------- [Please describe your issue here]
summary: SIPHASH on 32 bit processors without native CPU 64 bit integers (such as 32 bit x86) is atleast an order of magnitude slower than one at a time hash
See attached patch. I tried it on VC 2003 32 bit Win32 Perl\, no Quads\, and on VC 2003 32 bit Win32 Perl\, with Quads. Asm showed one_at_a_time being used on the with Quads Perl. I didn't do a make test on the Perls for this patch.
Perl no longer uses SIPHASH by default\, even for 64-bit builds\, so this patch is obsolete.
I discussed this briefly in #p5p\, and bulk88 would like the ticket kept open for now.
Tony
On Thu Jul 25 18:39:34 2013\, tonyc wrote:
Perl no longer uses SIPHASH by default\, even for 64-bit builds\, so this patch is obsolete.
I discussed this briefly in #p5p\, and bulk88 would like the ticket kept open for now.
Tony
Since this ticket is about which is the best/fastest hash algo for perl\, I did some research on the issue. I published http://www.cpantesters.org/distro/B/Benchmark-Perl-CoreHashes.html and testing DJB2 which was usually the fastest on my machine and most of the machines on cpantesters\, I discovered perl is severely broken with it. So this ticket is now blocked by #120208 now IMO.
-- bulk88 ~ bulk88 at hotmail.com
On Sat Oct 19 13:18:45 2013\, bulk88 wrote:
On Thu Jul 25 18:39:34 2013\, tonyc wrote:
Perl no longer uses SIPHASH by default\, even for 64-bit builds\, so this patch is obsolete.
I discussed this briefly in #p5p\, and bulk88 would like the ticket kept open for now.
Tony
Since this ticket is about which is the best/fastest hash algo for perl\, I did some research on the issue. I published http://www.cpantesters.org/distro/B/Benchmark-Perl-CoreHashes.html and testing DJB2 which was usually the fastest on my machine and most of the machines on cpantesters\, I discovered perl is severely broken with it. So this ticket is now blocked by #120208 now IMO.
#120208 was fixed in 54e07e2b21cb1f58c04d67bca2a311715ba8815e.
DJB2 probably isn't suitable as a default algorithm\, since the 32-bit space of seeds is too small to search for even an exhaustive search.
Tony
Given this ticket subject is not "What's the best hashing algorithm" and this discussion has died, I'm closing this case. If we want to discuss that in github issues, I suggest a new case.
Migrated from rt.perl.org#116054 (status was 'open')
Searchable as RT116054$