Slower drawImage than Chrome/Safari




8 years ago
7 years ago


(Reporter: bz, Unassigned)


Mac OS X

Firefox Tracking Flags

(Not tracked)



(4 attachments)

Created attachment 432206 [details]
Image for testcase

The attached testcase shows us about 1.5-2x slower than Chrome or Safari on the drawImage call (though a good bit faster than Opera).
In the attached testcase |profile| can be flipped to true to shark the loop.  85% of the time is under drawImage.  Under there (all times percentages of total testcase time):

48% moz_cairo_paint_with_alpha
6% nsLayoutUtils::SurfaceFromElement (QI, etc).
5% gfxContext::CopyPath
3% gfxContext::UpdateSurfaceClip
2% free()
2% gfxContext::Clip
1.5% moz_cairo_restore
1% gfxPattern ctor.
1% moz_cairo_save.

and various minor stuff (gfxPattern dtors, SetMatrix, Translate, etc).
One other note.  Of that 48% under paint, 11% is cairo_surface_set_clip.
(In reply to comment #4)
> For arm this should help a lot:

I don't think the image is being scaled.
Similarly on Windows XP, I get 17fps in Minefield, 32fps on Chrome beta.
Created attachment 432387 [details]
Oprofile data for microb browser on N900
Comment on attachment 432387 [details]
Oprofile data for microb browser on N900

This profile with
ctx.mozImageSmoothingEnabled = false;  
On N900 it show ~2fps
On iPod touch with latest firmware ~1fps
Created attachment 432388 [details]
Fennec QT, on N900 with image smoothing disabled, ~2.5fps
roc recently made some of this overhead go away, I think....

Comment 11

7 years ago
This looks to be related : those animations are ~8 times slower on Firefox Nightly 11.0a1 (2011-12-01) than on the current relase of Chrome.
It's mainly calls to DrawImage (source provided) :

Comment 12

7 years ago
Sorry, my report was related to Windows 7, not x86 mac. -_-
Could you please file a separate bug on that?  The drawing code is very much OS-specific, and this bug is about the Mac version of it.
In my most recent test, we're actually either slightly faster than or exactly the same speed as Chrome, and about 2x Safari. This is on 10.6, though.
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.