> When in doubt, test! All else is futile speculation:
> <http://www.nickfitz.co.uk/tests/javascript/get-id-v-dot.html>

Hi Nick,

Thanks for the script. I suspected your results may be a bit skewed because:
1) The DOM structure was very small
2) There are different implementations of the JavaScript engine.

I added some depth to the DOM tree and tested in 3 different browses all on
a Vista PC. It appears both FireFox and Safari use an optimized searching
algorithm (most likely hash tables). Internet Explorer seems to use a brute
force method:

FF 2.0.0.7
Overhead: 71
getElementById: 186
form.elements: 294

Safari 3.0.3
Overhead: 7
getElementById: 26
form.elements: 66

IE 7.0.6
Overhead: 54
getElementById: 5533
form.elements: 235

You can try for yourself here:
http://www.neighborwebmaster.com/tests/get-id-v-dot.html


Regards,
Kepler Gelotte




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to