Bug 139220 - Regression: Selection of elements is very slow
Summary: Regression: Selection of elements is very slow
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.1.6 target:7.2.1
Keywords: perf
Depends on:
Blocks: gtk3-whipping-boy
  Show dependency treegraph
 
Reported: 2020-12-25 11:06 UTC by martinstingl
Modified: 2021-08-18 20:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
About window screenshot (362.30 KB, image/png)
2020-12-25 13:51 UTC, martinstingl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martinstingl 2020-12-25 11:06:24 UTC
When I import this pdf file in Draw and try to select many items on the first page by drawing a rectangle with the mouse (or pressing CTRL+A) , it takes very long until the selection is done.
https://www.st.com/resource/en/datasheet/stm32f030f4.pdf
Comment 1 Telesto 2020-12-25 12:02:09 UTC
It's pretty OK on Windows.
Version: 7.2.0.0.alpha0+ (x64)
Build ID: 315c7570c4a72f4c834086082825533b1e50d1bf
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

Could you please copy help/about screen.. there are multiple backends (GTK3/GEN/etc) on linux
Comment 2 martinstingl 2020-12-25 13:51:30 UTC
Created attachment 168480 [details]
About window screenshot
Comment 3 lj618 2020-12-28 02:43:22 UTC
Confirmed.

It isn't specific to imported PDFs. You can duplicate the problem like this: Draw a small object like a filled ellipse. Select, use Duplicate to make 15 copies at a small offset. Now select all 16, copy, click off them, paste, move. Repeat, doubling each time.

Here are the times I get to select N ellipses on 2 different PCs running older and more recent LibreOffice. Note that PC #2 is much faster than #1 in general.

#1) Pentium-M, LibreOffice-6.2.8 32-bit on 32-bit Linux, Gtk2
# objects:   seconds to select:
  32           <1
  64           <1
 128           <1
 256           <1
 512           1
1024           2

#2) Core-2, LibreOffice-6.4.6 64-bit on 64-bit Linux, Gtk3
# objects:   seconds to select:
  32           <1
  64           <1 
 128           1
 256           3
 512          17
1024         128
 
I think I would call this a non-linear performance regression.
Comment 4 Xisco Faulí 2021-02-15 17:56:54 UTC
Do you reproduce the issue if you launch LibreOffice from commandline with
'SAL_USE_VCLPLUGIN=gen' ?
Comment 5 martinstingl 2021-02-15 18:12:17 UTC
The issue is not reproducible when I run LibreOffice with:
$SAL_USE_VCLPLUGIN=gen libreoffice
Comment 6 QA Administrators 2021-02-16 04:10:49 UTC Comment hidden (obsolete)
Comment 7 lj618 2021-02-24 21:13:22 UTC
Confirmed - me too. The selection speed goes back to 'normal' with SAL_USE_VCLPLUGIN=gen. The whole UI looks different though, and general graphics seems a bit slower with this. What is this doing? It changes the whole display 'driver', doesn't it? With the default for me on Linux being gtk3, and this environment variable uses a 'generic' or 'general' driver?

If so then I guess this is a Gtk+3 problem and maybe not fixable in LibreOffice, unfortunately.
Comment 8 raal 2021-04-20 16:23:23 UTC
Tested pressing CTRL+A on first page, confirm with Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 5348b3946b8f2b9581cdd8b40fa774c2a9d23868
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 9 Caolán McNamara 2021-04-20 19:00:47 UTC
I'd guess its a11y related and windows might be just as slow in a11y-enabled mode
Comment 10 Caolán McNamara 2021-08-17 13:50:39 UTC
time is spent in a11y svx/source/accessibility/ChildrenManagerImpl.cxx ChildrenManagerImpl::UpdateSelection
Comment 11 Commit Notification 2021-08-17 20:38:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3d45088a4885671a12dfa48e6c650cb896f7078e

Resolves: tdf#139220 with ~1000 selected shapes a11y UpdateSelection crawls

It will be available in 7.3.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.
Comment 12 Caolán McNamara 2021-08-17 20:54:22 UTC
That improves this, done in trunk and backports to 7-2 and 7-1 in gerrit. https://gerrit.libreoffice.org/c/core/+/120618 may also make a measurable improvement.
Comment 13 Commit Notification 2021-08-18 08:17:10 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/d6fcc3fb03a7bc35eb35ab7948803ff2682507de

Resolves: tdf#139220 with ~1000 selected shapes a11y UpdateSelection crawls

It will be available in 7.1.6.

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.
Comment 14 Commit Notification 2021-08-18 08:17:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/7ea5763aa766d0b4f25b0f089873dc2c8726cec5

Resolves: tdf#139220 with ~1000 selected shapes a11y UpdateSelection crawls

It will be available in 7.2.1.

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.
Comment 15 BogdanB 2021-08-18 20:30:41 UTC
Very fast now.
Verifed with
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 5b025285b3528910a4360899abb2bbbaadc72c97
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded