To test performance of finding value in array vs map

Benchmark created on


Preparation HTML

<script>
const arr = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10'
];

const map = {
'1': true,
'2': true,
'3': true,
'4': true,
'5': true,
'6': true,
'7': true,
'8': true,
'9': true,
'10' :true	
};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
find in arr
arr.includes('100')
ready
find in map
map['100']
ready

Revisions

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