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

Most folks probably write JavaScript for the browser.

Not only should you consider using object pooling for JS objects (like the author describes), but you also want to think about DOM element pooling, especially when you are dealing with large lists.




DOM element reference cacheing (and pooling) can significantly improve the responsiveness of very busy browser UI code (particularly in loops that make many DOM queries and/or updates) and can make the code more readable too, but be careful as you can create memory leaks especially in "classic" IE. Such leaks only tend to last as long as until the user navigates away, but they can become significant for single-page applications.


In many cases they can exist until the iexplore browser process terminates.


When using Object pooling, be sure that it causes an improvement, it can invoke pathologically bad performance from certain garbage collectors.




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

Search: