Posted By

iroybot on 02/22/09


Tagged

speed performance benchmark chili


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

iroybot
nerdfiles


Performance issues when modifying HTML with jQuery


 / Published in: JavaScript
 

URL: http://plugins.jquery.com/project/chili

I just found this interesting comment in the jQuery Syntax Hiliting Plugin "Chili". It seems, one should preferrably use innerHTML instead the core jQuery method... (Just to clarify: I didn't do any benchmarking myself)

  1. el.innerHTML = dish; //much faster than $el.html( dish );
  2. //tried also the function replaceHtml from http://blog.stevenlevithan.com/archives/faster-than-innerhtml
  3. //but it was not faster nor without sideffects (it was not possible to count spans into el)

Report this snippet  

You need to login to post a comment.