fill-stroke canvas

JavaScript performance comparison

Revision 2 of this test case created

Info

Test what's faster: stroke or fill.

Preparation code

<canvas id='testy'></canvas>
<script>
  var canvas = document.getElementById('testy'),
  ctx = canvas.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
fill
ctx.fillStyle = '#556677';
ctx.fillRect(0, 0, 10, 10);
ctx.fill();
pending…
stroke
ctx.strokeStyle = '#556677';
ctx.beginPath();
ctx.moveTo(0, 5);
ctx.lineTo(10, 5);
ctx.stroke();
ctx.closePath();
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