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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
</ul>
<div>
<a href="#">first</a>
<a href="#">second</a>
<a href="#">third</a>
<a href="#">fourth</a>
</div>
<script>
(function( jQuery ) {
var oldFirst = jQuery.fn.first;
jQuery.fn.first = function( selector ) {
if ( selector ) {
return this.find( selector ).eq(0);
}
return oldFirst.apply( this, arguments );
};
jQuery.fn.f2rst = function( selector ) {
if ( selector ) {
return this.find( selector+":first" );
}
return oldFirst.apply( this, arguments );
};
jQuery.fn.f3rst = function( selector ) {
if ( selector ) {
return $(document.querySelector( this.selector +" "+selector ));
}
return oldFirst.apply( this, arguments );
};
})( jQuery );
var $div = $("div");
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
eq(0) |
| ready |
a:first |
| ready |
querySelector |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.