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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div></div>
<div id="foo"></div>
<div class="bar"></div>
<script>
function select (selector, context) {
var c = selector.charAt(0),
method,
context = context || document;
if (c === '#') {
selector = selector.substring(1);
method = context.getElementById(selector);
}
else if (c === '.') {
selector = selector.substring(1);
method = context.getElementsByClassName(selector);
}
else {
method = context.getElementsByTagName(selector);
}
return method
}
var By = {
id: function _byId(id) {
return document.getElementById(id);
},
tag: function _byTag(tag, context) {
return (context || document).getElementsByTagName(tag);
},
"class": function _byClass(klass, context) {
return (context || document).getElementsByClassName(klass);
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
native |
| ready |
select |
| ready |
QSA |
| ready |
By |
| ready |
jQuery |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.