Compare regular iteration on nested & flat arrays (v5)

Revision 5 of this benchmark created on


Setup

const base = [...Array(100).keys()]

function processSync(item) {
  return base.find(x => x === item);
}

const data = [...Array(10000).keys()]

const nestedArr = [data, data, data];
const flatArr = [...data, ...data, ...data];

Test runner

Ready to run.

Testing in
TestOps/sec
2D array with nested loop
nestedArr.map(arr => {
  return arr.map(processSync);
});
ready
flattened array with loop
flatArr.map(processSync);
ready

Revisions

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