Math.round vs hack (v41)

Revision 41 of this benchmark created on


Preparation HTML

<canvas id="canvas1" width="500" height="500"></canvas>
<script>
  var can = document.getElementById('canvas1');
  var ctx = can.getContext('2d');
  
  
 
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
"proper" rounding
ctx.save();
ctx.restore();
ready
Hack rounding
ctx.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.