[Gllug] Faster maths?
Nix
nix at esperi.org.uk
Sat Mar 10 17:30:53 UTC 2007
On 10 Mar 2007, Andy Farnsworth uttered the following:
> 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).
[...]
>> 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.
Ah. HP-UXes were also often notable for very slow main memory accesses,
at least the ones I used were.
> 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.
Oh yes, definitely, if for no other reason than that the Perl hash is
implemented in C, while your own data structure probably isn't (unless
you're an XSist, of course.)
--
`In the future, company names will be a 32-character hex string.'
--- Bruce Schneier on the shortage of company names
-------------- next part --------------
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list