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>
let len = 1024;
let buffer = new Uint16Array(len);
let ch = "a";
let ch_code = ch.charCodeAt(0);
let intrinsic_string_concat = () => {
let result = "";
for (let i = 0; i < len; i++) {
result += ch;
}
result.length;
return result;
};
let decoder = new TextDecoder("utf-16le");
let textdecoder = () => {
for (let i = 0; i < len; i++) {
buffer[i] = ch_code;
}
let result = decoder.decode(buffer);
result.length;
return result;
};
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| intrinsic_string_concat | | ready |
| textdecoder | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.