|
Posted by gosha bine on 05/16/07 11:35
On 16.05.2007 13:01 Taras_96 wrote:
> Hi everyone,
>
> I'm wondering if anyone knows whether PHP does some indexing behind
> the scenes to make array searches faster.
>
> What I have is an array of around 100 000 elements, and I have a list
> of 1000 given element which I need to see whether they contained in
> the array. This means 1000 searches on an array of size 100 000. I'm
> hoping that PHP indexes it's keys using a binary tree or
> something.. :)
>
> Thanks
>
> Taras
>
php uses hash function to speed up access to array elements, namely
Bernstein's function, also known as "times 33"
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Navigation:
[Reply to this message]
|