Zepto.js selector performance vs jquery

Lukas Oppermann picture Lukas Oppermann · May 7, 2012 · Viewed 9.4k times · Source

I did see some test indicating that the id and class selector ($(#id); $(.class)) is slower than the jquery one.

I was wondering:

  1. Is the difference significant? (noticeable)
  2. Is the difference noticeable only if using it in a loop / selecting many elements?

I am thinking about switching to zepto for my desktop app since I only need modern webkit and firefox support anyway.

Thanks

Answer

ramy picture ramy · May 8, 2012

I found this jsperf test that indicates that the speed difference is significant: http://jsperf.com/qwery-vs-jquery-vs-mootools-selector-engines/11