jquery.html vs innerHTML (v29)

Revision 29 of this benchmark created by parkjongkweon on


Description

test

Preparation HTML

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>

<div id="list" style="display:none"></div>
<script>
var stringText = "aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa"
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
split
// async test
var html = '<div>Test :: ' + stringText.split('a').length + '</div>';
$('#list').html(html);
ready
match
// async test
var keyReg = new RegExp('(a)', 'ig');
var html = '<div>Test :: ' + stringText.match(keyReg).length + '</div>';
$('#list').html(html);
ready

Revisions

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