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
Is it quicker to retrieve a javascript file from localStorage than it is to let the browser fetch a cached copy from its own cache?
// A random URL from a CORS enabled data source
var url = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js";
// This can be synchronous for testing purposes
var xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
xhr.send();
if (xhr.status === 200) {
localStorage.test = xhr.responseText;
}
delete localStorage.test;
Ready to run.
Test | Ops/sec | |
---|---|---|
localStorage |
| ready |
Browser cache |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.