[thelist] Custom objects and performance in JavaScript

Matt Warden mwarden at gmail.com
Mon Nov 14 08:23:57 CST 2005


On 11/14/05, Tom Dell'Aringa <pixelmech at yahoo.com> wrote:
> var stateData = {
>         'colorado_image' : 'image.html',
>         'colorado_desc' : 'description.xml',
>         'scene2_image' : 'image2.html',
>         'scene2_desc' : 'description2.xml',
>         'scene3_image' : 'image3.html',
>         'scene3_desc' : 'description3.xml' };
>
> Is there a performance benefit/hit in using the object or is there basically no difference? If the
> data begins to grow to say 50-100 objects, what about then?

Object properties in JavaScript are implemented as hashes, anyway.
Additionally, even arrays are objects.

So, no, there's no difference.

--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list