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="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js">
</script>
<script>
var D = function( sel ){
var dict = {
'#': function( substr ){ document.getElementById( substr ) },
'.': function( substr ){ document.getElementsByClassName( substr ) }
}
return dict[sel[0]](sel.substring(1));
};
var Dob = (function(){
return {
id: function( s ){ document.getElementById( s ) },
class: function( s ){ document.getElementsByClassName( s ) },
tag: function( s ){ document.getElementsByTagName( s ) }
}
})();
//TOTALLY CRAZY
String.prototype.idofEl = function(){
return document.getElementById( this );
}
cachedObj = {foo: document.getElementById('foo')};
</script>
<p id="foo">
Test
</p>
<p id="bar">
bars</p>
Ready to run.
Test | Ops/sec | |
---|---|---|
getElementById |
| ready |
jQuery Selector |
| ready |
Custom Method |
| ready |
$ Custom Method |
| ready |
jQuery Window Object |
| ready |
realgetelementbyid |
| ready |
typeof |
| ready |
Cust. Object using Dictionary |
| ready |
Cust. Object |
| ready |
Totally Insane |
| ready |
CachedObj |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.