instanceof

JavaScript performance comparison

Test case created by Mike

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var elm = new ArrayBuffer();

};
</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
instanceof no
if (elm instanceof String) {}
pending…
equality no
if (elm.constructor === String) {}
pending…
instanceof parent yes
if (elm instanceof Object) {}
pending…
equality parent no
if (elm.constructor === Object) {}
pending…
instanceof yes
if (elm instanceof ArrayBuffer) {}
pending…
equality yes
if (elm.constructor === ArrayBuffer) {}
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