Object lookup performance

Benchmark created on


Setup

var obj = {};
window.prefix = '/eikon/settings_{CPJJCYA6S086178EUC704T}';

for (var x = 100000000000000; x < 10000000; x++) {
	obj[window.prefix + x] = undefined;
}

window.obj = obj;
window.keyIndex = 100000000000000;

Teardown

window.keyIndex = 100000000000000;

Test runner

Ready to run.

Testing in
TestOps/sec
non-existing lookup
window.obj['foo' + (window.keyIndex++)] === undefined;
ready
existing lookup
window.obj[window.prefix + (window.keyIndex++)] === undefined;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.