cers-distance

JavaScript performance comparison

Test case created by Christian Sonne

Preparation code

<script src="http://geeksbynature.dk/projects/distance/distance.js"></script>
<script>
Benchmark.prototype.setup = function() {
    const rows = 500;
    const cols = 500;
    var data = Array(rows*cols);
    for (i=0; i<cols*rows; i++)
      if (i>=cols*rows/2 && i%cols<cols/2)
        data[i] = 1;
      else
        data[i] = 0;
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
distance
var data = Array(rows*cols);
for (i=0; i<cols*rows; i++)
  if (i>=cols*rows/2 && i%cols<cols/2)
    data[i] = 1;
  else
    data[i] = 0;
var im = new ImgPUInt32(data, rows, cols);
im.log = false;
im.edt_meijster2000();
pending…
distance 2
var data = Array(rows*cols);
for (i=0; i<cols*rows; i++)
  if (i>=cols*rows/2 && i%cols<cols/2)
    data[i] = 0;
  else
    data[i] = 1;
var im = new ImgPUInt32(data, rows, cols);
im.log = false;
im.edt_meijster2000();
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment