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
Based on my StackOverflow question: What is the most efficient way to update images in the DOM?
http://stackoverflow.com/questions/13795003/what-is-the-most-efficient-way-to-update-images-in-the-dom/13795092
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="img1">
<img src="http://farm8.staticflickr.com/7244/7339763896_6b3a7487fe_s.jpg" />
</div>
<div id="img2">
<img src="http://farm9.staticflickr.com/8016/7339765048_d83ffbb15d_s.jpg" />
</div>
var $c1 = $("#img1"),
$c2 = $("#img2"),
$img1 = $c1.find('img'),
$img2 = $c2.find('img'),
i1 = document.querySelector("#img1 img"),
i2 = document.querySelector("#img2 img");
Ready to run.
Test | Ops/sec | |
---|---|---|
Replace element (jquery) |
| ready |
Update src (jquery) |
| ready |
Swap (no jquery) |
| ready |
swap (jquery move element ) |
| ready |
swap (jquery repaint ) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.