Bug 112532 - Color picker widget is slow to initialize - does not cache color palette data
Summary: Color picker widget is slow to initialize - does not cache color palette data
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
: 106588 113983 138491 (view as bug list)
Depends on:
Blocks: Color-Picker-Widget
  Show dependency treegraph
 
Reported: 2017-09-20 17:25 UTC by Gabor Kelemen (allotropia)
Modified: 2020-11-25 16:32 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-09-20 17:25:08 UTC
While working on bug#105000 - and sprinkling a few SAL_WARN into SvxUnoConvertResourceStringBuiltIn() of svx/source/unodraw/unoprov.cxx [1] - I noticed that the color picker widget runs this color palette initalization method every time it is instantiated. 
This is problematic if there is a window with more than one of this widget, like Options - LibreOffice - Application colors or Options - Writer - Changes, causing slow reaction from the window and a spike in CPU usage as well.

For each widget instance it seems like the current color palette is being read and processed, but this seems to be unnecessary a bit and might be cacheable for better performance. 

[1] https://opengrok.libreoffice.org/xref/core/svx/source/unodraw/unoprov.cxx#1588
Comment 1 Julien Nabet 2017-09-20 18:43:50 UTC
I agree. It seems we call PaletteManager ctr quite a lot each time we access this.
On the contrary if you change the color of the word with button on standard bar, it creates a new PaletteManager which stays until you close LO.

There's also a pb of memory leaking, see tdf#111894 and new try to fix this: https://gerrit.libreoffice.org/#/c/42494/2
Comment 2 Julien Nabet 2017-09-20 18:44:46 UTC
Telesto: even if you're not a dev, thought you might be interested in this one since it concerns perf/leak
Comment 3 Telesto 2017-09-21 11:17:07 UTC
*** Bug 106588 has been marked as a duplicate of this bug. ***
Comment 4 Aron Budea 2017-11-21 22:31:36 UTC
*** Bug 113983 has been marked as a duplicate of this bug. ***
Comment 5 Aron Budea 2017-12-24 08:53:33 UTC
I have a fix in the works for caching palettes, but it's not going to solve the slowness of initializing many color picker widgets (what isn't related to file reading). Anyway, it's better than nothing, and one of the duplicate tickets can be reopened for the remaining performance issue.
Comment 6 Xisco Faulí 2018-03-26 18:57:38 UTC
Dear Aron Budea,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 7 QA Administrators 2019-11-07 03:33:36 UTC Comment hidden (obsolete)
Comment 8 NISZ LibreOffice Team 2020-11-25 16:32:26 UTC
*** Bug 138491 has been marked as a duplicate of this bug. ***