getset tests

JavaScript performance comparison

Test case created and last updated

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var p = { "grph":{"id":{"ptr":{"index":{"id":{"ptr":{"index":1234}}}}}}}
    function l() { this.graph = p; this.gg = p["grph"]["id"]["ptr"]["index"]["id"]["ptr"] }
    var m = new l();
    l.prototype.test1 = function () {l.prototype.id = {"ptr":"123"}}
    l.prototype.test2 = function () {this.tp.id = {"ptr":"1234" }}
    l.prototype.test3 = function() {  p["grph"]["id"]["ptr"]["index"]["id"]["ptr"]["index"] = "1234" }
    l.prototype.test4 = function() {  this.gg["index"] = {"ptr":"1234" }}
   
};
</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
a
p["grph"]["id"]["ptr"]["index"]["id"]["ptr"].index = "123";
p["grph"]["id"]["ptr"]["index"]["id"]["ptr"].fuckthis = "xx";
p["grph"]["id"]["ptr"]["index"]["id"]["ptr"].x= "whatever";

p["grph"]["id"]["ptr"]["index"]["id"]["ptr"].y= "0";
 
pending…
r
var f = p["grph"]["id"]["ptr"]["index"]["id"]["ptr"]
f.index = "xyz";
f.fuckthis = "xxx"
f.x = "whatever"
f.y = "0"
pending…
dg
var f = 134
var m = "abc"
 
pending…
var f= 1234
f = "abc"
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