Canvas save-restore

Benchmark created by Leo on


Preparation HTML

<canvas id="myCanvas" width="320" height="240"></canvas>
<script>
  var str = "@abcdefghijklmnopqrstuvwxyz";
  var myCanvas = document.getElementById("myCanvas");
  var context2d = myCanvas.getContext("2d");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
save-restore
context2d.save();
context2d.transform(1, 2, 3, 4, 5, 6);
context2d.restore();
ready
manual reset
context2d.transform(1, 2, 3, 4, 5, 6);
context2d.setTransform(1, 0, 0, 1, 0, 0);
ready

Revisions

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