returned Function vs sequential calls

JavaScript performance comparison

Test case created by Joshua M

Preparation code

<script>

function doSomething(msg) {
   // stuff
   return doSomething;
}

function doOneThing(msg) {
  // stuff
}

</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Returned Function
doSomething('asd')('123')('sdf');
pending…
Sequential Function
doOneThing('asd');
doOneThing('123');
doOneThing('sdf');
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

0 comments

Add a comment