compile v. runtime

JavaScript performance comparison

Test case created by Josh Gruber

Info

See what the performance impact of different build-time optimizations are.

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a = 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
runtime
var isDebug = false;

function log(message) {
  if (isDebug === true) {
    console.log(message);
  }
}

a += 1;
log('current value is ' + a);
pending…
build time function
function log(message) {

}

a += 1;
log('current value is ' + a);
pending…
build time log statement
a += 1;
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