fillRect vs moveTo,lineTo

JavaScript performance comparison

Test case created by vova

Info

canvas fillRect vs moveTo,lineTo

Preparation code

<canvas id="c" width="100" height="100"></canvas>
<script>
  c = document.getElementById('c');
  ctx = c.getContext('2d');
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
fillRect
ctx.fillRect(5,10,90,1);
pending…
moveTo,lineTo
ctx.beginPath();
ctx.moveTo(5,10.5);
ctx.lineTo(95,10.5);
ctx.closePath();
ctx.stroke();
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