Vanilla Animation vs jQuery

Benchmark created by David on


Description

Code Examples from Vanilla-js.com

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="thing">
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Vanilla JS
var s = document.getElementById('thing').style;
s.opacity = 1;
(function fade() {
  (s.opacity -= .1) < 0 ? s.display = "none" : setTimeout(fade, 40)
})();
ready
jQuery
$('#thing').fadeOut();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.