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
A benchmark to see if the size of strings stored in localStorage affects its set performance.
<script>
</script>
function repeat(pattern, count) {
if (count < 1) return '';
var result = '';
while (count > 0) {
if (count & 1) result += pattern;
count >>= 1, pattern += pattern;
};
return result;
};
var small = repeat("XXXXXXXXX-", 100); //1k
var medium = repeat("XXXXXXXXX-", 1000); //10k
var large = repeat("XXXXXXXXX-", 10000); //100k
var xlarge = repeat("XXXXXXXXX-", 100000); //1M
localStorage.clear();
Ready to run.
Test | Ops/sec | |
---|---|---|
Set small value (1k chars) |
| ready |
Set medium value (10k chars) |
| ready |
Set large value (100k chars) |
| ready |
Set xlarge value (1M chars) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.