drawImage whole pixels
JavaScript performance comparison
Preparation code
<canvas id="screen"></canvas>
<script>
var ctx = document.getElementById("screen").getContext("2d");
var image = document.createElement("img");
image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
whole pixel |
|
pending… |
sub pixel |
|
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
- Revision 7: published
- Revision 8: published
- Revision 9: published
- Revision 10: published by skyblue
- Revision 12: published
- Revision 13: published
- Revision 14: published by ryan jacobson
- Revision 16: published
- Revision 17: published
3 comments
Weird that I got more ops/sec with subpixel draw.
Testing in Chrome 8.0.552.224 on Windows 7
whole pixel 6,655 ±6.84% 11% slower
sub pixel 7,542 ±4.43% fastest
Same here
Testing in Chrome 8.0.552.224 on Windows 7 whole pixel 2,176 ±5.30% fastest sub pixel 2,361 ±3.74% fastest
I've found that sub-pixel drawing is WAY slower on OSX than it is on Windows. Would be good if browsers were also grouped into OS, right? :)