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
As of jQuery 1.4 we can pass advanced objects with attribtutes, texts and events directly (as second argument) when creating a new element.
This saves additional calls to .text(), .click() or attr() etc.
How do they perform ?
Also in the test: Raw strings that use innerHTML.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
function myFunction() {
alert("Clicked");
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
AttrString (innerHTML) |
| ready |
AttrString (innerHTML) + Event |
| ready |
AttrObject (createElement) |
| ready |
AttrObject (createElement) + Event |
| ready |
props (createElement) |
| ready |
props (createElement) + Event |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.