4 ms·
HTML5 Canvas drawText() considered harmful
- wccrawford 16y agoAwesome post. More should be like this. It clearly defines the issue (and a solution), with data to show it. Bonus for extra data detailing when it might not be a good idea as well. Sad about the flamebait title, though. It's not 'harmful', it's 'inefficient'. Crazily so. But not 'harmful'.
- simonsarris 16y agoHarmful enough to performance to be avoided, was what I was thinking. Maybe it is a bit too sensational though...
- beej71 16y agoIf you consider everything that goes into rasterizing a line of text, it's not entirely surprising that a bitmap draw is considerably faster. ("Cache to bitmap".) This is definitely a good place to optimize, though, if one needs to. What's super funky is the difference between Chrome and The Rest. I'd not have expected that. It's probably Google tracking your font rendering choices. ;-) ;-) Edit: "performance murder" and the opening graphic are pretty hilarious.