4 ms·
Care to substantiate your benchmark where you compare jQ1, jQ2, and the native DOM API?
by lowboy 13y ago
Care to substantiate your benchmark where you compare jQ1, jQ2, and the native DOM API?
- LukeShu 13y agoHere is the mentioned pull request: https://github.com/jashkenas/backbone/pull/2959 https://github.com/jashkenas/backbone/pull/2959 Here is his benchmark: http://jsperf.com/backbone-patch-22be8f9/2 http://jsperf.com/backbone-patch-22be8f9/2 It only compares jQuery 1 and the DOM API, no jQuery 2. TestBaseView: DOM API TestPaulView: Reduced jQuery usage TestView: jQuery
- wyuenho 13y agoYep that's it. You can replicate this benchmark and replace jq1 with jq2 to see how much faster it gets. You'll be disappointed.
- lowboy 13y agoHmm, I'm wary of a test that involves another framework to test the underlying jQ v. Native DOM performance difference. I'd be much more comfortable eliminating Backbone from the equation. Also, this is just one test - wyuenho's claim was for jQ vs. the DOM in general, which is a much broader claim than an unknown subset of functionality. I don't doubt that native DOM methods are faster than jQ, but I like claims to be backed up by evidence.
- wyuenho 13y agoThe evidence is in the form of an experiment repeatable from your browser's dev console. Play with it.
- lowboy 13y agoIf you hand me some code to run, I'll run it. Otherwise my test risks not being the same one that you used to make the claim. The onus is on the person making the claim, not the person trying to verify it.
- jhenahan 13y agoIsn't the code to run here[1]? [1]: http://jsperf.com/backbone-patch-22be8f9/2 http://jsperf.com/backbone-patch-22be8f9/2
- lowboy 13y agoSee my previous comment[0]. That perf test is testing Backbone's use of jQ vs. native DOM, not jQ v. DOM in isolation. I don't trust that there aren't side effects and interactions in the test. [0]: https://news.ycombinator.com/item?id=7155710 https://news.ycombinator.com/item?id=7155710