4 ms·
> It is easily the worst browser with respect to Canvas performance. I thought so too, until I added Math.floor(x) to positions in drawImage(). When you give
by pornel 15y ago
> It is easily the worst browser with respect to Canvas performance.
I thought so too, until I added Math.floor(x) to positions in drawImage().
When you give fractional positions, Opera takes it literally and does rendering with costly anti-aliasing for subpixel precision.
Once I rounded the numbers, Opera turned out to be the fastest.
- simonsarris 15y agoI actually made tests a while ago to show precisely those two things, namely flooring and drawImage, are 10x as slow on Opera. First let me note that on average using Math.floor(x) results in slower performance than using x | 0. I'd recommend using the latter way instead. And even then Opera is an order of magnitude slower at flooring numbers compared to FF5, IE9 and Chrome 14: http://jsperf.com/bit-thingies http://jsperf.com/bit-thingies Opera's drawImage is also an order of magnitude slower than Chrome 14, IE9 and FF5. Note that in this link the FF8Beta, Ipad, and the first two Chrome versions were ran by someone else's machine, so those results can't be compared with the other numbers. http://jsperf.com/render-vs-prerender http://jsperf.com/render-vs-prerender If you don't believe them, of course, I urge you to run them for yourself.
- pornel 15y agoI stand corrected. Chrome has gotten really fast since worked with canvas (last year).