| Store | Cart

Re: about "Switch default hash to SIPHASH on 64 bit builds andONE_AT_A_TIME on 32 bit builds"

From: H.Merijn Brand <h.m....@xs4all.nl>
Wed, 5 Dec 2012 16:58:15 +0100
On Wed, 5 Dec 2012 10:52:35 -0500, bulk88 <bul...@hotmail.com> wrote:

> demerphq wrote:> > On 5 December 2012 02:28, bulk88 <bul...@hotmail.com> wrote:> >> http://perl5.git.perl.org/perl.git/commit/3db6cbfca39da94d152d3e860e2aa79b9c6bb161> >> why? what are the disadvantages?> > > > Murmurhash has been broken. It is too easy to attack. We cant use it> > as the default hash for perl.> > > > SipHash is secure and relatively fast. One-at-a-time we believe is> > relatively secure at least with the modification I made to it earlier> > this year.> > > > SipHash relies on 64 bit types, so cannot build on a 32 bit computer.> > > > Thus I made the default be SipHash for 64 bit builds and 32 bit builds> > will continue to use One-at-a-time.> > > >> What is the difference between a 64 build> >> and a 32 bit build? What about compilers/platforms that have compiler> >> emulated 64 bit integers, like 32 bit x86?> > > > If someone can figure out how to build SipHash in this situations it> > would be nice.> > > > Cheers,> > Yves> > > > Perl can be built with emulated 64 bit ints ( USE_64_BIT_INT, I know > Cygwin Perls by default have 64 bit IVs on 32 bit x86). These emulated > 64 bit ints are slower than 32 bit ints since the compiler emulates them > with function calls. For an actual example, here is the code a Win32 > compiler uses to emulate a 64 bit int multiply > http://www.jbox.dk/sanos/source/lib/llmul.asm.html . Maybe you should > use a combination of pointer size (which is always native to the CPU), > and U64 to select the correct hash algorithm, if the pointer is 32 bits, > then the hash algo should be the 32 bit one. But, what about non-x86 > CPUs that might have native 64 bit ints but 32 bit memory?

I always build my perls on i686 (Linux) with

  -Duse64bitint -Duselongdouble

even if these "int"s might be slower, I never checked, I think I value
the wider range for numerics over performance, as I hit 0x7fffffff
quite often in the real world, and that has no impact with -Duse64bitint

> I think I saw some benchmarks on the different hash algorithms a month > or 2 ago on the ML someone posted but I can't find the post.

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.17   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Recent Messages in this Thread
bulk88 Dec 05, 2012 01:28 am
Craig A. Berry Dec 05, 2012 01:30 pm
demerphq Dec 05, 2012 09:50 pm
bulk88 Dec 05, 2012 10:57 pm
Craig A. Berry Dec 06, 2012 04:50 am
bulk88 Dec 07, 2012 12:40 am
demerphq Dec 06, 2012 07:35 am
bulk88 Dec 07, 2012 12:20 am
bulk88 Dec 07, 2012 01:00 am
bulk88 Dec 07, 2012 03:35 am
bulk88 Dec 05, 2012 11:00 pm
bulk88 Dec 05, 2012 03:52 pm
H.Merijn Brand Dec 05, 2012 03:58 pm
Brad Gilbert Dec 09, 2012 04:49 pm
Messages in this thread