This vs Objects

JavaScript performance comparison

Test case created by Akshay Joshi

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="el">
  blahe
</div>
<script>
  Obj = Obj || {}
 
  Obj.o = $('#el');
 
  Obj.test1 = function() {
    Obj.o.hide();
    Obj.o.g();
  }
 
  Obj.test2 = function() {
    this.o.hide();
    this.o.g();
  }
</script>

Preparation code output

blahe

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Object
Obj.test1();
pending…
This
Obj.test2()
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