I have been using domec. Are plug-ins like these much more inefficient than just using jQuery's built in methods?
Is it ineffecient to use a jQuery extension to create your HTML?
87 views Asked by Metropolis At
3
There are 3 answers
0
![zigdon](/img/user-default.png)
Any time you compromise convenience for efficiency (one way or the other), you're making a choice. If it's worth it or not depends on the application. Sometimes, the environment your application will be executed in has plenty of leeway, and efficiency is just not a concern. Other times, speed is of the essence, and it's worth the developer's time to spend a few extra hours to save the end user a few seconds.
Bottom line, you have to make your own decisions. If performance is an issue, benchmark your code, and use the data you collect decide.
This depends entirely on HOW you are adding the html. If you are using methods such as .html() or innerHTML that do not manipulate the DOM, these are inherently faster than DOM manipulating functions such as .append(). Each has a different purpose.
To answer your question: yes, it is potentially inefficient to do this. An extension is only going to give you jQuery's native performance AT BEST. The fastest you could achieve would be to write fully optimized javascript.
Your question is analogous to, "Is inefficient to use a PHP framework to generate your webpages compared to compiled C code?"