Array vs Hashtable lookup

Benchmark created by Barry G on


Test runner

Ready to run.

Testing in
TestOps/sec
array
var array = [0,1,2,3,4,5,6,7,8,9,10]

return array[5]
ready
hashtable
var hash = {
zero : 0,
one : 1,
two : 2,
three : 3,
four : 4,
five : 5,
six : 6,
seven : 7,
eight : 8,
nine : 9,
ten :10
}

return hash.five
ready

Revisions

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