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>
<ul id="test">
<li class="test">
<li class="test">
<li class="test">
</ul>
<script>
;// just in case
(function (win) {
win.g = win.g || {init:[]};
var doc = document;
g.init.push(function _assignClassMethod() {
if (doc.getElementsByClassName) {
g.getClass = function _getClass(className, ele) {
ele = ele || doc;
return ele.getElementsByClassName(className);
}
} else {
g.getClass = function _getClass(className, ele) {
ele = ele || doc;
var childElements = ele.getElementsByTagName("*"),
retArr = [],
regex = new RegExp("\\b" + className + "\\b");
for (var i = 0, len = childElements.length; i < len; i++) {
if (regex.test(childElements[i].className))
retArr.push(childElements[i]);
}
return retArr;
}
}
});
for (var i = 0, len = g.init.length; i < len; i++) {
g.init[i]();
}
}(window));
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
jquery |
| ready |
custom |
| ready |
getbyId |
| ready |
custom2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.