Skip to content

Instantly share code, notes, and snippets.

@hns
hns / getprop.js
Created July 30, 2011 13:33
micro-benchmark for property access
function bench(x) {
for (var i = 0; i < 10000000; i++) {
if (x.foo) x.baz;
if (x.bar) x.mur;
if (x.dng) x.foo;
if (x.baz) x.bar;
if (x.mur) x.dng;
}
}