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
Tests the difference between reading from localStorage as compared to reading data from an object.
<script>
var O = {};
var cache = {
storage: {},
get: function (key) { return this.storage[key]; },
set: function (key, value) { this.storage[key] = value; },
clear: function () { this.storage = {}; }
};
localStorage.foo = "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }";
O.foo = "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }";
cache.set('foo', "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }");
var value;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
| ready | |
| ready | |
| ready | |
| ready | |
| ready | |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.