getset tests
JavaScript performance comparison
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.
| Test | Ops/sec | |
|---|---|---|
a |
|
pending… |
r |
|
pending… |
dg |
|
pending… |
|
pending… | |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments