in reply to Re: Re: Efficiency Question
in thread Efficiency Question

Yes, 30 hash lookups is slower than walking an array with foreach.

OTOH one hash lookup is much faster than walking a good chunk of an array.

If you can arrange that straight lookups happen more often than having to walk the whole cache, then you should get a performance win. (See code in my other node.)