Canvas Float Point vs Rounded Points
JavaScript performance comparison
Preparation code
<canvas id="c" width="500" height="500"></canvas>
<script>
Benchmark.prototype.setup = function() {
var c = document.getElementById('c');
var ctx = c.getContext('2d');
var cw = c.width;
var ch = c.height;
var rand = function(rMi, rMa){return ~~((Math.random()*(rMa-rMi+1))+rMi);}
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
float |
|
pending… |
floor |
|
pending… |
newround |
|
pending… |
<< 0 |
|
pending… |
^ 0 |
|
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:
- Revision 1: published by Jack Rugile
- Revision 2: published
- Revision 3: published
- Revision 4: published by 1Pupik1989
0 comments