append vs appendTo performance (jQuery 1.9.1)
From what can be seen in jQuery code, one of the reasons appendTo has better performance is because the implementation of appendTo is a bit more complicated than regular additions.
While append depends roughly on the built-in appendChild function, appendTo is a jQuery add-on that needs to be handled by code (there is an extra loop inside appendTo that works with the elements and actually calls .append again). While the performance hit is small (if you are simply comparing the simplest use, for example, in this example: http://jsperf.com/sdp-jquery-append/5 ), this is certainly to keep in mind.
As in the example with the inscription "Better" in the associated jsperf:
It works better because in the fastest version (in jsperf that you are attached to) you just collect the html to add, rather than adding it at each iteration.
It saves browser resources, since there is no need to reschedule and redraw the content at each iteration.
source share