I am wondering this question,
is jQuery currently using native query selector API?
from this benchmark: http://jsperf.com/jquery-vs-document-queryselector
the performance of native API is dramatically faster than jQuery library
will jQuery use the native API to increase query performance?
If you look at the latest codebases:
1.11.1 https://github.com/jquery/jquery/blob/1.11.1/dist/jquery.js#L1200
2.1.1 https://github.com/jquery/jquery/blob/2.1.1/dist/jquery.js#L1164
They both check for the support of querySelectorAll, and will use that. You will get similar speed than when using jquery and querySelectorAll in the case it exists (Some performance differences may exist because of the extra function calls). The good thing is that you're sure that it works in older browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With