Hacker News new | past | comments | ask | show | jobs | submit login

You are also measuring parseFloat(hdn.value) - but I haven't measured how much of impact it is.

EDIT - Turns out it takes significant amount of time compared to the rest of the frame, more on chrome, a bit less on Firefox (but the timing profiles are very different on the two browsers).

parsing floats is not fast! :) (Many edge cases)




Oh I know! I realised that later on when I reviewed the code but I gave up worrying about demonstrating the speed of DOM access* when it started to crash my browser! So I've left this version here for posterity.

* I wanted to demo to some people why it's better to write javascript that avoids going back and forth to the DOM all the time.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: