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>
var veryLongText = '';
for (var a = 0; a < 10000; a++) {
veryLongText += 'word ';
}
var BUTTON = document.createElement('BUTTON');
document.body.appendChild(BUTTON);
var TEXTAREA = document.createElement('TEXTAREA');
document.body.appendChild(TEXTAREA);
var DIV = document.createElement('DIV');
DIV.contentEditable = true;
DIV.innerHTML = veryLongText;
var style = DIV.style;
style.position = 'fixed';
style.top = 0;
style.left = 0;
style.width = '100px';
style.height = '100px';
document.body.appendChild(DIV);
if (typeof style.opacity !== 'undefined') {
style.opacity = 0;
} else {
/*@cc_on @if (@_jscript)
if(typeof style.filter === 'string') {
style.filter = 'alpha(opacity=0)';
}
@end @*/
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
value + select() |
| ready |
innerHTML + select() |
| ready |
selectionStart |
| ready |
createRange |
| ready |
createRange/selectNodeContents |
| ready |
IE (moveToElementText) |
| ready |
IE (moveStart/moveEnd) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.