minified vs. minified

JavaScript performance comparison

Test case created by John-David Dalton

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.js"></script>
<script>
var dev = _.noConflict();
</script>
<script src="https://dl.dropbox.com/u/513327/lodash.min.fast.js"></script>
<script>
var fast = _.noConflict();
</script>
<script src="https://dl.dropbox.com/u/513327/lodash.min.slow.js"></script>
<script>
var slow = _.noConflict();
</script>
      
<script>
Benchmark.prototype.setup = function() {
  var dev  = window.dev;
  var fast = window.fast;
  var slow = window.slow;
  
  var numbers = Array(100);
  for (var index = 0; index < 100; index++) {
    numbers[index] = index;
  }

};
</script>

Preparation code output

<script> var dev = _.noConflict(); </script> <script src="https://dl.dropbox.com/u/513327/lodash.min.fast.js"></script> <script> var fast = _.noConflict(); </script> <script src="https://dl.dropbox.com/u/513327/lodash.min.slow.js"></script> <script> var slow = _.noConflict(); </script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
dev
var result = dev.contains(numbers, 50);
pending…
fast
var result = fast.contains(numbers, 50);
pending…
slow
var result = slow.contains(numbers, 50);
pending…

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

Compare results of other browsers

1 Comment

John-David Dalton (revision owner) commented :

Keep in mind if you're running a jsPerf test from within your iOS Twitter client app or other WebView you're running without JIT enabled. Try running this jsPerf in Safari mobile instead.