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

A compiled function only gives you a really fast string creator. It doesn't make the innerHTML call any faster than it is (which is really fast, but slower than the DOM).

You can also use cloneNode to cache frequently reused DOM snippets.




The creation of a complex DOM tree(nested loop, partials, recursion) is what is slow compared to string concatenation. The injection time of the string need parsing, and will take a bit longer. But in total less time than DOM manipulations.

I'm trying for a few months now to remove the last innerHTML bits of pure.js and haven't figured out a way yet to make it as fast.




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

Search: