jQuery, Javascript, and Mootools Performance Comparison (v10)

Revision 10 of this benchmark created on


Description

We'll modify an element's text and then change a couple CSS properties.

Preparation HTML

<div id="text">Let's change this text</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$('#text').html('The text is changed').css({
        backgroundColor: 'red',
        color: 'yellow'
});
ready
Javascript
var text = document.getElementById('text');
text.innerHTML = 'The text is changed';
text.style.backgroundColor = 'red';
text.style.color = 'yellow';
ready
Mootools
document.id('text').set('html','The text is changed').setStyles({
        'background-color': 'red',
        'color': 'yellow'
});
ready

Revisions

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