[Gllug] Faster maths?
Andy Farnsworth
farnsaw at stonedoor.com
Sat Mar 10 01:33:44 UTC 2007
Nix wrote:
> On 9 Mar 2007, Andy Farnsworth told this:
>
>> Hashing in perl has been highly optimized. I have used hashes on the
>> order of a million entries and it has worked extremely quickly (<1
>> second for 1000 lookups).
>>
>
> I'm sorry, but for a linear-probing hash table that's not exactly
> shining performance. You should be approximating memory bandwidth speed
> (obviously not dcache speed), which should be *vastly* higher than that.
>
> Not-very-optimized C hashing libraries I've written in the past have
> managed >50000 lookups per second on 500MHz SPARCs. The only part I
> optimized, and this is where I think the difference lies, is the hashing
> function (Jenkins has some *very* good ones: he also has some slightly
> less good ones, one of which is the one Perl 5 is using).
>
> But if you're only getting 1000 hash lookups per second, I'd start to
> profile perl if I were you. Something is wrong in there.
>
<snip>
Whoops, I left out a bit. This was 8 years ago in 1999 on a ~300 mhz
HPUX machine.
I am sure on modern hardware you should be several orders of magnitude
faster. I would have to do a bit of testing today, but I know that when
I tried to do this using my own data structure it took a much longer
time than when I just dropped it into a perl hash.
Andrew Farnsworth
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list