Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My read was that Internet Explorer couldn’t realize that a string variable could be reused over and over so each iteration of the loop it was allocating a new one, using it, and then garbage collecting it. Basically tons of unnecessary overhead.

Having the programmer define a variable before the loop and then reuse it each iteration meant that all that allocation and garbage collection wasn’t necessary during the passes of the loop.



That is exactly right.




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

Search: