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>
<div id="somediv">
<p id="foo" class="bar">
Test
</p>
<p id="foo2" class="bar">
Test2
</p>
<p id="foo3" class="bar bars">
Test3
</p>
<p id="foo4" class="bar">
Test4
</p>
</div>
<script>
jQuery.fn.dom = function() {
return this[0];
};
function GetClass (selector, context, asJquery, fromParent) {
if (IsNotDefined(context)) {
context = document;
}
else {
context = GetDom(context);
}
if (fromParent) {
context = parent.document;
}
var stuff = context.getElementsByClassName(selector);
if (asJquery) {
return $(stuff);
}
else {
return stuff;
}
};
function IsDefined (value) {
return typeof value !== "undefined" && value != null;
};
function IsNotDefined (value) {
return !IsDefined(value);
};
function GetDom (object) {
if (IsDefined(object.jquery)) {
return object.dom();
}
return object;
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
jquery |
| ready |
DOM |
| ready |
DOM with jq |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.