jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
An update to triggering JS functions based on data-behaviors to use querySelectorAll to hunt through the DOM rather than jQuery.
I wrote about this method in .Net in October 2012 (http://www.creativebloq.com/javascript/get-your-javascript-order-4135704) and stole the idea from Adam Berlin's "Elemental JS" (https://github.com/elementaljs/elementaljs). These tests are inspired by Roberto Dip's "Essential JS" (https://github.com/roperzh/essential.js).
An update to my article will be published soon on http://opticalcortex.com/
First two tests are run by looking at the DOM. Second two tests are the same function, where a jQuery object of HTML is used. Both use the same markup.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
</div>
<ul>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
</ul>
<div>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
<p>Test</p>
<p data-behavior="test1">Test</p>
<p>Test</p>
<p data-behavior="test1 test_2">Test</p>
</div>
<ul>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
<li>Test</li>
<li data-behavior="test1">Test</li>
<li>Test</li>
<li data-behavior="test1 test2">Test</li>
</ul>
var a17 = {
};
a17.Behaviors = {
}
a17.str = "";
a17.Behaviors.test1 = function(container){
a17.str += container.tagName + "(test1) ";
};
a17.Behaviors.test2 = function(container){
a17.str += container.tagName + "(test2) ";
};
Ready to run.
Test | Ops/sec | |
---|---|---|
querySelectorAll_tryCatch |
| ready |
querySelectorAll_testApply |
| ready |
querySelectorAll_testCall |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.