4 ms·
The types of optimizations you are suggesting are extremely hard to track down. If you have a laggy list you only know that you have a laggy list.. changing a s
by MatthewPhillips 14y ago
The types of optimizations you are suggesting are extremely hard to track down. If you have a laggy list you only know that you have a laggy list.. changing a single $('<div></div>') to document.createElement('div') probably isn't the thing that will speed up your application. It's probably not a single function or even a set of functions that is causing the problem. It's probably that in order to gain the 'sticky' affect you want that jquery plugin you're using is listening to a window.onscroll or something, and unless you want to dig into the code of every library you're using you probably won't know why.
When you're working in the mobile web and performance is important you want to know what every line of code is doing. Your application is probably going to be a little laggy anyways, but at least you'll know why that is and know where to target to try and fix it.
- mistercow 14y ago>The types of optimizations you are suggesting are extremely hard to track down Except that it's not, because you can use profiling in modern browsers to figure out where the time is being spent. >It's probably that in order to gain the 'sticky' affect you want that jquery plugin you're using is listening to a window.onscroll or something, and unless you want to dig into the code of every library you're using you probably won't know why. But that's not what the author is arguing, and it has nothing to do with adding elements to the DOM via jQuery vs via lower level methods.