On Mon, Mar 2, 2009 at 12:22 PM, Nicholas Clark <n...@ccl4.org> wrote:

> On Mon, Mar 02, 2009 at 10:23:38AM -0800, Bill Ward wrote:
>
> > Personally I always use hashes for objects.  Hashes are pretty fast in
> Perl,
> > especially when there aren't many keys, so I don't think the benefits of
> > using arrays are worth it.  The risk of typos is pretty small, and the
>
> Hash lookup should be O(1), independent of number of keys. Of course, a
> hash
> with more keys uses more memory, but so does an array with more elements.


Yes, hashes are fast... but they do use memory and string operations are
inherently slower than integer ones... O(n) by length of the keys if nothing
else :)

Reply via email to