fill-stroke canvas

JavaScript performance comparison

Revision 4 of this test case created by Ryan

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
stroke
ctx.globalAlpha = 0.5;
ctx.fillStyle = '#556677';
ctx.fillRect(0, 0, 10, 10);
pending…
fill
ctx.fillStyle = 'rgba(80, 80, 80, 0.5)';
ctx.fillRect(0, 0, 10, 10);
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