Proper test for property
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var obj = Object.create(null, {
foo : {
get : function() {
return 'value';
}
}
});
var propName = 'bar';
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
in |
|
pending… |
direct compare |
|
pending… |
direct typeof |
|
pending… |
indexer compare |
|
pending… |
indexer typeof |
|
pending… |
direct implicit |
|
pending… |
indexer implicit |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments