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
<div id="myID"></div>
<script>
function $(s, e) {
if (!s) {
return;
}
e = e || document;
var r = e.querySelectorAll(s);
return r.length === 1 ? r[0] : r;
}
Element.prototype.replaceClass = function(oC, nC) {
if(this.hasClass(oC)) {
this.className = this.className.replace(new RegExp("(\\b|^)" + oC + "(\\b|$)"), nC);
}
return this;
};
Element.prototype.replaceClass2 = function(oC, nC) {
this.className = this.className.replace(new RegExp("(\\b|^)" + oC + "(\\b|$)"), nC);
return this;
};
Element.prototype.hasClass = function(c) {
return this.className.match(new RegExp("(\\b|^)" + c + "(\\b|$)")) !== null ? true : false;
};
var obj = $("#myID");
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
check |
| ready |
nocheck |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.