Description: It may take up to a minute to select an SVG object that consists of many draw:path> elements within content.xml when selecting with the mouse pointer in the document canvas. The selection is immediate when selecting the same object in the Navigator pane. Ubuntu 22.04 and Clear Linux running Gnome and xorg are affected. Possibly other Linuxes are affected as well. Xorg appears to make many kernel memcpy calls while LibreOffice is frozen upon selecting the object. The "slow" SVG object in content.xml follows this syntax: > <draw:g draw:style-name="gr1"> > <svg:title>TEST</svg:title> > <draw:path draw:style-name="gr2" draw:text-style-name="P1" draw:layer="layout" svg:width="20.723cm" svg:height="14.884cm" svg:x="6.298cm" svg:y="0.026cm" svg:viewBox="0 0 20724 14885" svg:d="..."> > <text:p/> > </draw:path> > <draw:path draw:style-name="gr3" draw:text-style-name="P2" draw:layer="layout" svg:width="0.235cm" svg:height="0.19cm" svg:x="6.294cm" svg:y="0.116cm" svg:viewBox="0 0 236 191" svg:d="..."> > <text:p/> > </draw:path> > > ... repeat the above <draw:path> elements a few hundred times ... > > </draw:g> Steps to Reproduce: On Linux, select an SVG object that consists of many paths in content.xml Actual Results: Selection take a very long time, depending on complexity and number of elements in the group. Expected Results: Selection should be quick Reproducible: Always User Profile Reset: Yes Additional Info: Does not seem to affect Windows
Created attachment 189235 [details] example .odp file demonstrating the issue
On which LO version are you? You may find recent LO version here: https://launchpad.net/~libreoffice/+archive/ubuntu/ppa
Clear Linux $ soffice --version LibreOffice 7.6.0.3 60(Build:3) Ubuntu 22.04 $ soffice --version LibreOffice 7.5.5.2 50(Build:2)
Thank you for the quick feedback, I put it back to UNCONFIRMED. Xisco: thought you might be interested in this one since it concerns svg. If useful, I can provide a Flamegraph.
Selecting speed is so, so on Windows. Shrinking the shape is slow; dragging (the shrinked) shape is also slow Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: c9916d9be9c060d43fc063b76d70629162650fea CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win Locale: nl-NL (nl_NL); UI: en-US Calc: CL threaded
(In reply to Telesto from comment #5) > Selecting speed is so, so on Windows. Shrinking the shape is slow; dragging > (the shrinked) shape is also slow > Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: c9916d9be9c060d43fc063b76d70629162650fea > CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win > Locale: nl-NL (nl_NL); UI: en-US > Calc: CL threaded Even worse in Versie: 4.4.7.2 Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600 Locale: nl_NL
Selection seems immediate in Windows and MacOS in recent versions of LO. It's interesting that Linux select in Navigator is fast while select in document canvas is very slow.
Slow selecting occurs in every Linux I have tested so far. Clear Linux Version: 7.6.0.3 (X86_64) / LibreOffice Community Build ID: 60(Build:3) CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded Ubuntu 22.04 #1 (standard kernel) Version: 7.5.5.2 (X86_64) / LibreOffice Community Build ID: 50(Build:2) CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Ubuntu package version: 4:7.5.5~rc2-0ubuntu0.22.04.1~lo1 Calc: threaded Ubuntu 22.04 #2 (hwe kernel) Version: 7.5.5.2 (X86_64) / LibreOffice Community Build ID: 50(Build:2) CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Ubuntu package version: 4:7.5.5~rc2-0ubuntu0.22.04.1~lo1 Calc: threaded It's also slow in a clean install of Ubuntu 23.04.
(In reply to Julien Nabet from comment #4) > Thank you for the quick feedback, I put it back to UNCONFIRMED. > > Xisco: thought you might be interested in this one since it concerns svg. > If useful, I can provide a Flamegraph. Hi Julien, Yes, could you please do so ? Thanks in advance
Created attachment 189301 [details] Flamegraph Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today + gen rendering.
I'm curious why this bug is associated with OLE. A simple curve drawn in Impress or Draw, then duplicated ~1000 times and grouped causes extreme slowness in select, de-select, Navigator pane updates, file save, etc. The slowness seems to be many times worse in Linux than in Windows and MacOS.
For the benefit of any other coders that come along, I took a brief look, and the problem is that when we select the group object, we initially think we are going to do a drag, and we then spend a very long time constructing a complicated "drag view" of the group object. So there are two problems (1) we should really not be constructing a drag object when we are selecting (2) we should probably just construct an outline of the object to display while dragging, instead of trying to draw the whole thing.
Noel Grandin committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9f4ccc63346b26d8d774b22124da0842ef18e0bc tdf#156995 speed up dragging complex group objects It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for looking at this. I have not looked at the daily build yet. However, I noticed a difference in "drag view" behavior across Windows and Linux. Is it intentional that Linux, unlike Win_x86-64, has no limits on the number of curve points when drawing drag previews? Are these limits set differently based on operating system? Are they dependent on hardware or settings? In Windows, a rectangular bounding box is drawn instead of a "real" drag view when dragging a group of Bézier curves having more than a total of 500 points. The limit appears to be 200 points for a selection of curves (as opposed to a selected group of curves). In Linux, there appears to be no upper limit to the number of points and LO tries to generate a "real" drag view regardless of the complexity of the group object.