Inkscape + Cairo >= 1.12 very slow on Windows, unless rulers are hidden
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Inkscape |
Fix Released
|
High
|
Patrick Storz | ||
| cairo |
Unknown
|
High
|
|||
Bug Description
Bug reproduced on Windows XP 32bits when testing Cairo 1.12+ versions to fix various Cairo related bugs. It affects computers with some (but not all) Intel graphic cards, which become almost unusable.
Reference inkscape-devel post: http://
Also mentioned in http://
The issue doesn't affect the current official devlibs used with 0.48.x and the trunk, but could be a blocker to the fix required for Bug #804162 "pixelated bitmaps on canvas and export with Cairo rendering". Thus I don't know how to manage the bug status and importance. Don't hesitate to change it to more appropriate values if needed.
I'm currently updating some libraries for Inkscape on win32, and notice a serious UI slowdown when updating the Cairo libs. Everything works as expected with Cairo-1.11.2 (the dll we provide with the latest stable Inkscape version, 0.48.4), but the Inkscape UI becomes very slow when drawing or moving objects on canvas with a more recent Cairo version (tested with 1.12.0, 1.12.8, 1.12.14, 1.12.16 and yesterdays git version). I've also updated Pixman to 0.32.4, but noticed no regression with the Pixman update as long as I don't update Cairo too.
I've tried with different compilers (TDM-GCC-4.5, TDM-GCC-4.6 and TDM-GCC-4.8.1) with no difference.
Other operating systems are not affected (tested on Debian stable with Cairo-1.12.2 and Pixman-0.26, but other Inkscape users confirmed it's ok with recent Ubuntu and OS-X versions).
Tested again on another computer with an nvidia GeForce 210 (GT218) and found out it is not affected (Windows XP Virtualboxed on Debian stable).
IIRC the affected computers were all running Intel graphic cards. I'm going to investigate and give details on the affected GPUs later today.
I can reproduce the bug with two computers with the following graphic cards:
* Intel HD Graphics 2500 (Dell Optiplex 3010),
* Intel GMA 4500 (Dell Optiplex 780).
Also reproduced with Intel 82945G Express.
NOT reproduced with
* ATI Mobility Radeon HD 4500 Series;
* NVidia Quadro 1000M;
* NVIDIA GeForce GTX 660 Ti;
* Intel HD 3000 (integrated).
See the Inkscape-devel mailing list thread for details (http://
just copying a comment from: http://
I just downloaded your file : inkscape-
It runs fine for me, with just one rectangle with a radial gradient and very fast dragging, 2 Windows machines.
Windows XP, CPU: Intel 2.2GHz, Display: Mobile Intel 965 Express Chipset
when dragging, Inkscape used 50% of CPU time, at rest it used 0%
Windows 7 (32 bit), CPU: Pentium 3.2GHz, Display: Intel G41 Express Chipset
when dragging, Inkscape used 40% of CPU time, at rest it used 0%
LucaDC first reported the slowdown with an Intel 82945G Express graphic card.
I'm wondering if it could be due to the device drivers...
1.12.0 was released March 23, 2012, so if the performance was due to changes to cairo, it would show up in the changelog for prior to this period.
And in fact I notice that in Feb/Mar of that year there was a considerable amount of work done in src/win32 when the win32 code was split out and rebased to the new compositor infrastructure. I don't see any noteworthy perfomance work done in win32 subsequent to March 23rd. So, guessing maybe there was some unfinished performance work, at least for certain breeds of hardware?
@JazzyNico - just wondering, does hiding the ruler in Inkscape have any affect on the performance on affected computers?
(Recent Windows builds of GIMP with newer cairo version also seem to be affected by performance issues related to cairo - GIMP users noticed that hiding the ruler improves performance. AFAIK Inkscape's ruler widget is based on code from GIMP. If the ruler updates contribute to the performance issues tracked here, maybe this recent commit in GIMP could be ported and tested with Inkscape:
<https:/
@~suv - Thanks for the link! I'll try to test your tip the next time I have access to an affected computer (maybe later today).
@~suv - Good catch! I've tried with an old rev. 12282 with Cairo 1.12.8, and disabling the ruler fixes the issue.
Thanks you (and Gimp).
Confirming that hiding the ruler causes significant improvement on Windows 7 x64 with Inkscape 0.91pre4. Dragging the workspace stutters with rulers enabled and is fluid with them hidden.
I can confirm that hiding the ruler fixes a performance issue on Inkscape 0.91 r13725 on Windows 8.1.
Thanks to suv/su_v and the rest of the people on IRC for pointing this out. It appears to be getting quite a bit of attention.
+ Inkscape + Cairo >= 1.12 very slow on Windows
this might not be related but just the same issue (very slow performance on calligraphy, pen or text box.
https:/
+ Inkscape + Cairo >= 1.12 very slow on Windows, unless rulers are hidden
- Patch against 0.91 Edit (1.8 KiB, text/plain)
I have a possible way to fix this bug.
What I noticed is that Inkscape queues redraws to the canvas by using `gdk_threads_
This patch changes `sp_ruler_draw_pos` to be called by queuing the function with `gdk_threads_
Tested this with 0.91 64-bit under Windows 7, with Intel HD Graphics 4000
This patch, however, causes another minor rendering bug when dragging the drawing area around very quickly. I guess this has something to do with priorities also.
One thing though, I mainly tested drawing with the Bezier tool.
Also, I have no idea how this fix is related to cairo at all.
GTK+ developers feel it is abhorrent to draw outside of the expose/draw handler (yes, we do this in the canvas, and it's bad; and doing this doesn't work correctly in GTK+ 3.0), so I cannot recommend this patch.
On 2015年01月11日 22:27 (+0200), ~suv wrote:
> (Recent Windows builds of GIMP with newer cairo version also seem to
> be affected by performance issues related to cairo - GIMP users
> noticed that hiding the ruler improves performance. AFAIK Inkscape's
> ruler widget is based on code from GIMP. If the ruler updates
> contribute to the performance issues tracked here, maybe this recent
> commit in GIMP could be ported and tested with Inkscape:
> <https:/
The mentioned GIMP commit had been backported to inkscape trunk by Liam P. White on 2015年02月25日:
* Revision 13941: Backport commit 2086344 from GIMP master: try to fix rulers (bug #1351597)
https:/
Today a final fix for the same issue was committed in GIMP:
* https:/
* diff in GIMP master:
https:/
Anyone willing/able to investigate this second commit in GIMP to address ruler performance issues on Windows for backporting to Inkscape trunk too (the second commit in GIMP is on top of the first one, it removes most of the changes the first one had added), and to offer patched 64bit Inkscape builds for Windows (with cairo 1.14) for testing?
On 2015年08月13日 19:35 (+0200), ~suv wrote:
> Today a final fix for the same issue was committed in GIMP:
> (...)
It was not yet the final fix after all; due to a regression the last commit introduced on Linux, there are two more follow-up commits also to be considered for backporting to Inkscape. Please see this gist for details:
* https:/
Direct links to the commits:
* https:/
* https:/
- 1351597-CairoSlowRulers.diff Edit (11.0 KiB, text/plain)
Patch tested on Windows XP, Inkscape trunk rev. 14630, Cairo 1.14.6.
Inkscape is no longer slow, but I didn't test the ruler extensively for regressions yet.
Windows testers are more than welcome!
Test binary available: ftp://download.
- bug_1351597.diff Edit (14.4 KiB, text/plain)
Good news:
I just created a patch that combines the four relevant GIMP commits [1-4].
It solves the issue for me on Windows 7 using the latest devlibs64 (gcc 5.3 branch [5]), i.e. cairo 1.15.2.
Testers are welcome, especially to check if this causes any regressions I did not notice.
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
Ah crap! What are the chances? I'm just seeing Nicolas's fix from just an hour ago...
No activity for five months and then two fixes in just under an hour.
@Eduard - My patch doesn't include the very last commits in the gimp code, and therefore probably misses some fixes or optimizations. I'm going to test yours so that we could fix the issue (and possibly push the new Pixman/Cairo versions in the win32 devlibs).
- bug_1351597_v2.diff Edit (14.4 KiB, text/plain)
@Eduard - I had to modify your patch because it didn't compile with the current win32 devlibs. The G-SOURCE-REMOVE macro was added in glib-2.32, but we still use glib-2.28 (and I don't really want to update it now...). See https:/
So I used the old g_source_remove() function instead (hope I used it correctly...) and it compiled and worked as expected.
New patch (based on Eduard's, comment #22) attached.
@Testers, the patch fixes thinks for Windows, but could affect other systems and gtk versions. Could you please test it on Gnu/Linux and OS-X, with Gtk2 and Gtk3 builds? Thanks!
On 2016年02月14日 10:57 (+0100), jazzynico wrote:
> Could you please test it on (...) OS-X, with Gtk2 and Gtk3 builds?
Patch tested sucessfully (no obvious regressions noticed) on OS X 10.7.5
with Inkscape 0.91+devel r14648:
- GTK+/X11 2.24.13, gtkmm 2.24.2, GLib 2.32.4, glibmm 2.32.1
- GTK+/X11 2.24.29, gtkmm 2.24.4, GLib 2.46.2, glibmm 2.44.0
- GTK+/X11 3.18.6, gtkmm 3.16.0, GLib 2.46.2, glibmm 2.44.0
- GTK+/Quartz 2.24.29, gtkmm 2.24.4, GLib 2.46.2, glibmm 2.44.0
- GTK+/Quartz 3.18.6, gtkmm 3.16.0, GLib 2.46.2, glibmm 2.44.0
Tests are limited though (I did not test with Wacom tablet (Bamboo
CTH-470); a small screen (13-inch) might not expose issues observed in
fullscreen mode on large monitors).
There are a few compiler warnings (3 with llvm-gcc-4.2, FSF GCC 4.6.3; 1
with clang) about "missing-
sp_ruler_
outdated compilers, idk.
- 1351597-Screenshot-Xubuntu-GTK2.png Edit (50.7 KiB, image/png)
~suv> There are a few compiler warnings
Confirmed on Xubuntu 15.10, with gcc-5.2.
With GTK2, the ruler is noticeably larger (see screenshot). I didn't see the same change with Windows XP.
@JazzyNico - AFAIU the "larger" rulers in trunk are due to the new toggle icon to lock guides (rev >= 14512), not to the patch.
Patch also tested successfully with GTK3 and a Wacom Bamboo tablet, on Xubuntu 15.10, and committed in the trunk rev. 14670.
Assigning to Eduard as author of the patch (many thanks!).
Still needs to be tested with the 0.91.x branch.
- bug_1351597_0.91.diff Edit (14.7 KiB, text/plain)
Verified working also in 0.91 branch.
(Tested on Windows 7 x64, Inkscape 0.91 r13857 built with updated devlibs64 gcc 5.3 branch)
See patch attached.
Fix applied to the 0.91.x branch rev. 13858.
Cairo and Pixman updated in the official win32 devlibs rev. 61.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https:/