function call vs inline

JavaScript performance comparison

Test case created by tenbits

Preparation code

<script>
var index = 0;
function increment(){
 index++;
}
</script>
<script>
Benchmark.prototype.setup = function() {
    index = 0;
};
</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
function
increment();
pending…
inline
index++;
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