Today, I have read a useful article which explains the performance issues for javascript execution on Opera. I think, this is also applicable for regular javascript execution on other browsers too.
http://userjs.org/help/tutorials/efficient-code