« Call for testing: patterns | Main | Call for testing: cairo-1.0.0 »
September 16, 2005
Win32 backend renderer revisited
About three months ago I ran some benchmarks using cairo as a backend instead of the default GDI+ renderer on MS-Windows. As cairo has moved on and we're looking at upgrading to cairo-1.0.0 to fix OS-X problems, I figured it was time to rerun the numbers and see how things look these days.
Some timing results of cairo vs. GDI+ for Hixie's simple SVG performance tests - time in seconds. Built from the MOZILLA_1_8_SVG_BRANCH tag, which has cairo-1.0.0.
| cairo | gdi+ | |
|---|---|---|
| test1 (complex paths) | 16.4 | 16.1 |
| test2 (complex paths with transparency) | 16.5 | 15.8 |
| test3 (text) | 5.4 | 5.3 |
| test4 (images) | 24.6 | 6.1 |
| test5 (linear gradients) | 43.5 | 147.3 |
| test6 (radial gradients) | 48.5 | 17.9 |
Things look quite a bit better than last time, enough that it's tempting to switch from GDI+ to cairo for Firefox 1.5. It would make all the platforms behave the same, remove the support issue of people without the GDI+ library (anyone pre-WinXP), and fix some rendering issues that can't be addressed otherwise, like the reflect/repeat modes of radial gradients.
If you'd like to experiment with using a MS-Windows build with the cairo backend, you can download one from here. Remember to close any Firefox windows when switching between browsers to test, otherwise you just get a new window from the currently running Firefox. I'd like to hear any feedback about what you think of this build - speed, any rendering issues, etc?
Posted by tor at September 16, 2005 12:10 AM
Comments
Impressive improvements! I'm looking forward to seeing this in the official trunk builds.
Posted by: Rishi at September 16, 2005 2:11 AM
That linear gradients number doesn't look so nice. What's the deal?
Posted by: Alex Vincent (WeirdAl) at September 16, 2005 2:17 AM
Not sure - GDI+ is just slow on linear gradients for some reason.
Posted by: tor at September 16, 2005 2:24 AM
Do you have the results for OS X using a cairo 1.0.0 build of Firefox (as compared to the current cairo build)?
;-)
Posted by: Kyle Rove at September 16, 2005 4:23 AM
tor,
I'd like to see the move to Cairo happen sooner than later (a reversal of my previous opinion 3 months ago). Had I realized that GDI+ might have to be downloaded by a large portion of Firefox users before they'll even see SVG, I would have been behind it the whole way earlier too. Better something slow than the potential for nothing at all, I say.
Surprised to hear that this could happen for Fx 1.5 though, since the Beta has already shipped, but hey, you guys are the developers...
I'll try to download the cairo-ized version of Fx 1.5 and test it out tomorrow. Based on your linear gradients benchmark above, I'd expect http://www.codedread.com/yastframe.php to be much faster with the linear gradient background on.
Jeff
Posted by: Jeff Schiller at September 16, 2005 4:53 AM
Gecko 1.8 Mac builds and trunk Mac builds use older versions of Cairo. I made a Mac build from this branch (with Cairo 1.0.0), which you can download from
http://www.squarefree.com/builds/svgbranch/firefox-1.4.en-US.mac.dmg. It might only work on Mac OS X 10.4.x.
Posted by: Jesse Ruderman at September 16, 2005 4:56 AM
Jeff: moving win32 svg to cairo for Firefox 1.5 is an outside possibility, and would require discussion of risk (speed, stability, and rendering quality) versus gain (platform parity, easier support).
Requiring GDI+ was seen as not such a big problem prior to 1.5b1, where we would display a dialog informing the user of a missing library when they tried viewing SVG. Unfortunately a side effect of a patch to make SVG disabled modes act uniformly means we can't do that anymore (at least, seemingly not in a clean way).
Posted by: tor at September 16, 2005 5:39 AM
Does cairo 1.0 improve on the dashed curves/font quirks mentioned on the status page?
Posted by: FP at September 16, 2005 7:31 AM
I tested the cairo based release and I must say I'm dissapointed. Really. Firefox already has serious performance issues ( I think it's the slowest browser), adding Cairo would make it even slower (?!). So, where does the user win ?
just my 2c
Posted by: Emil Tamas at September 16, 2005 7:39 AM
My results:
Cairo GDI+
test 1 : 20.60s 17.29s
test 2 : 17.55s 17.20s
test 3 : 5.71s 5.43s
test 4 : 25.57s 6.94s
test 5 : 28.31s 143.01s
test 6 : 34.75s 19.05s
Posted by: Erik at September 16, 2005 10:46 AM
FP: cairo still does not implement dashed curved lines. There are some win32 specific problems with cairo font selection that I need to look into.
Emil: not sure what your comments are referring to - the whole browser or just SVG performance? This possible change in renderers will only affect SVG.
Posted by: tor at September 16, 2005 2:08 PM
This example from croczilla doesn't appear to be rendering correctly:
http://www.croczilla.com/svg/samples/foreign1/foreign1.xml
Posted by: Todd at September 16, 2005 3:13 PM
foreignObject has been disabled in the builds for some time now, so that's expected.
Posted by: tor at September 16, 2005 4:20 PM
My results:
Cairo GDI+
test 1 : 17.75s 16.95s
test 2 : 17.64s 17.06s
test 3 : 5.42s 5.42s
test 4 : 31.18s 7.06s
test 5 : 36.96s 161.49s
test 6 : 42.05s 18.58s
I can sure live with these results so that we don't have to explain how to install the GDI+.dll for all the non-XP users (like me!). If the user is told to install a different download just to view SVG they won't bother. I think SVG has to work out of the box even if performance is not the ultimate yet.
Posted by: Bruce Rindahl at September 16, 2005 9:52 PM
here are some more rendering problems, sorry :-(
http://www.treebuilder.de/svg/svg.svg
the foreground gets partitionally deleted.
http://www.treebuilder.de/svg/sokoban/sokoban.svgz
the player disappears.
http://www.treebuilder.de/svg/mousewheel/scroll.svg
and here the strokes of the circles are not closed.
i hope that my last post and this one are not considered spam, because of the many links i've posted.
Posted by: Holger Will at September 17, 2005 7:10 AM
Here are the comparisons of Firefox 1.5 Beta 1 and the Firefox build mentioned above for OS X using cairo 1.0.0 on my old iBook:
0.5.0 1.0.0 % faster
_____ _____ ________
93.13 83.78 10.0%
94.97 83.42 12.2%
73.63 21.75 70.5%
645.03 150.46 76.7%
135.42 104.05 23.2%
159.22 123.00 22.7%
The improvements certainly speak for themselves.
Posted by: Kyle Rove at September 18, 2005 3:34 AM
Wow, cairo made some great progress.
Indeed the cairo Version was much faster with the linear gradient background on at http://www.codedread.com/yastframe.php , this is really noticable!
Some results with my XP3200+/6800GT, latest Nightlies and Cairo Version from above:
Branch Trunk Cairo
16,98 16,92 17,2
17,03 16.91 17,17
5,69 5,48 5,67
6,45 6,03 22,31
106,39 105,95 35,5
14,78 14,63 39,2
Posted by: Stebs at September 18, 2005 6:52 AM
Bugs with this build on Win32:
1) http://www.codedread.com/svghead.svg, when you bring up some Firefox menus overtop of the "CodeDread" masthead and then collapse the menu, the portion of the text that was under the menu has its fill removed. This can be restored by forcing the browser to repaint (switching tabs, etc). This happens with the "Go", "Bookmarks", "Tools", or "Help" - but NOT with the "File", "Edit" and "View" menus. Must be something to do with detection of repaint areas...?
2) http://www.svgbasics.com/examples/basic_shapes_circle1.svg the circle stroke is not closed properly.
Posted by: Jeff Schiller at September 19, 2005 5:19 PM
Have a look at https://bugzilla.mozilla.org/show_bug.cgi?id=309765
It suggests that the performance problem with linearGradients on GDI builds is specific to gradients that are not perfectly horizontal or vertical.
Anyway, I would certainly vote for the Cairo renderer across 1.5 release to avoid spending the developer time for our SVG based project on dealing with *both* renderer limitations *and* trying to handle the differences between them.
Posted by: Amos at September 24, 2005 8:53 AM
I also think to switch to cairo on all platforms would be a great idea.
Cairo is an projects for abstracting vector graphics, why should Mozilla duplicate this work and write interfaces for I know how many target vector libraries.
Cairo is almost as fast as GDI+ and I am sure it will even improve by another 20-50%.
lg Clemens
Posted by: Linuxhippy at October 31, 2005 2:47 PM
I think Firefox the slowest browser. I'm dissapointed, really, from tested the cairo.
Posted by: Stella at December 8, 2005 6:12 PM
To my personally I do not like Cairo
Posted by: partitions musique at January 10, 2006 5:08 PM