data-locality-demo

Benchmark created by Daniel on


Setup

var matrix = [];
  for(var i = 0; i < 10; i++){
    matrix.push([]);
  }
  var i, j;

Test runner

Ready to run.

Testing in
TestOps/sec
bad locality
for(j = 0; j < 1000; j++){
  for(i = 0; i < 10; i++){
    matrix[i].push(j);
  }
}
ready
good locality
for(i = 0; i < 10; i++){
  for(j = 0; j < 1000; j++){
    matrix[i].push(j);
  }
}
ready

Revisions

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