[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua is faster than Java?
- From: David Given <dg@...>
- Date: Tue, 26 Jul 2005 00:15:52 +0100
On Monday 25 July 2005 23:07, Mike Pall wrote:
[...]
> I think it was Rici who suggested to me on IRC that a
> sufficiently optimized and inlined hash method dispatch
> comes pretty close to the performance of multi-level linear
> dispatch. The above data supports that reasoning.
*nods*
Hash tables are disturbingly fast --- a well tuned hash table can be faster
than an AVL tree, for example. (But the 'well tuned' bit is *really
important*.)
One technique we use extensively at work is to have some complex data
structure --- AVL tree, hash table, etc --- with a very small cache;
typically only four slots or so. Doing a cache lookup can then be done
inline; on the ARM you should be able to do it with a certain amount of
cheating in four instructions. Depending on your access patterns this can
have a surprisingly good effect.
--
"Curses! Foiled by the chilled dairy treats of righteousness!" --- Earthworm
Jim (evil)
Attachment:
pgpmuYXOeGSZS.pgp
Description: PGP signature