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
The most basic browser scripting operation: retrieving an element reference by ID.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
/*
* Context here is an HTML5 document
* Appropriate build for this context would exclude XHTML support
* Next line asserts document will create an HTML DOM
* There are virtually no documents on the Web that create an XHTML DOM
*
*/
var API = { disableXmlParseMode:true };
</script>
<script src="//www.cinsoft.net/mylib099-min.js"></script>
<script>
// For My Library test
var getEBI = API.getEBI;
// For cross-browser test
// NOTE: Should use isHostMethod (or variation) for host feature detection
// Degrades in IE 4 :)
if (document.getElementById) {
var getElement = function(id) {
var el = document.getElementById(id);
// Can remove next bit if name/ID issues not present in markup
// Fails immediately on name/ID mixup (as seen in legacy IE browsers)
// If not sure, leave it in.
if (el.id != id) {
return null;
}
return el;
};
}
// For all tests
var el;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
My Library |
| ready |
jQuery |
| ready |
Cross-browser |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.