Original Array vs Closure split() 'optimisation'

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
regular
$.each(['append', 'prepend', 'after', 'before', 'attr', 
          'removeAttr', 'addClass', 'removeClass', 'toggleClass', 
          'remove', 'css', 'show', 'hide'], function (i, n) {
});
ready
Closure split() optimisation
$.each("append,prepend,after,before,attr,removeAttr,addClass,removeClass,toggleClass,remove,css,show,hide".split(","),function(b,c){});
ready

Revisions

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