Download it now!
Bug 89004 - Choosing "Document Colors" from font/background palette takes 2-3 minutes with 100% CPU use
Summary: Choosing "Document Colors" from font/background palette takes 2-3 minutes wit...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All Linux (All)
: high minor
Assignee: ursache
URL:
Whiteboard: target:4.5.0 target:4.4.2
Keywords:
Depends on:
Blocks: Document-Colors-Palette
  Show dependency treegraph
 
Reported: 2015-02-01 00:49 UTC by Ron Johnson
Modified: 2017-04-24 09:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
ODS that demonstrates the bug. (70.04 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-01 01:52 UTC, Ron Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Johnson 2015-02-01 00:49:37 UTC
Hi,

When choosing the Document Colors palette for cell background, there is an approximately 10 second surge in CPU usage.  The first time that I tried to choose that palette, I think there was a much longer delay.  I was about to kill the process when the surge ended and control was returned to the user.

I tried the same thing on a spreadsheet that's 6x longer and the wait was 3 minutes.  I get the sense that the routine must scan the whole document to generate the palette.
Comment 1 Joel Madero 2015-02-01 01:22:19 UTC
Please attach a document that we can see this 3 minute wait. I just did a test on a spreadsheet with about 10 cells with different colors and saw no delay.

Ubuntu 14.04 x64
LibreOffice 4.4.0.2 rc

Marking as NEEDIFNO. Please attach the document and let us know what your system is running (OS + Distro at least). Once you do this mark the bug as UNCONFIRMED. Thanks
Comment 2 Ron Johnson 2015-02-01 01:30:29 UTC
It has sensitive financial data.  I'll have to see if I can create a sanitized version of it.
Comment 3 Ron Johnson 2015-02-01 01:52:50 UTC
Created attachment 113011 [details]
ODS that demonstrates the bug.

This is the sanitized version of the document.  Note how long it takes to choose the Document color palette.
Comment 4 m.a.riosv 2015-02-01 03:54:44 UTC
I'm not able to reproduce.

Win7x64
Version: 4.4.0.3 Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7

Please could you try resetting the user profile, sometimes solves strange issues.
https://wiki.documentfoundation.org/UserProfile
Comment 5 Ron Johnson 2015-02-01 05:54:43 UTC
"try resetting the user profile, sometimes solves strange issues."

Maybe that helped some, since it only took 1:25 this time.

Linux 64 bit
Version: 4.4.0.3
Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Locale: en_US
Comment 6 m.a.riosv 2015-02-01 17:42:01 UTC
Is the same when selecting font color or line color?
Comment 7 Ron Johnson 2015-02-01 19:50:08 UTC
(In reply to m.a.riosv from comment #6)
> Is the same when selecting font color or line color?

Font color: yes.
Line color: ??  Format Cells->Borders->Color has a drop-down list.
Comment 8 m.a.riosv 2015-02-01 21:44:14 UTC
Please verify if options in Menu/Tools/LibreOffice/View - Graphics Output, has some influence.
Comment 9 Jean-Baptiste Faure 2015-02-02 05:31:35 UTC
Not reproducible for me too with my own build of version 4.4.1.0.0+ under Ubuntu 14.10 x86-64.

Best regards. JBF
Comment 10 Ron Johnson 2015-02-03 21:12:05 UTC
(In reply to m.a.riosv from comment #8)
> Please verify if options in Menu/Tools/LibreOffice/View - Graphics Output,
> has some influence.

The bug is a CPU-bound scan through the document, not an issue of display.
Comment 11 Ron Johnson 2015-02-03 21:17:13 UTC
Are there -dbg versions of LO 4.4?  I tried to run strace, but after a bit of startup, it sat at:
shutdown(3, SHUT_RDWR)                  = 0
close(3)                                = 0
futex(0x1bcf0a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 7, {1422999234, 628689000}, ffffffff) = 0
Comment 12 Joel Madero 2015-02-04 02:24:42 UTC
I'm setting this to new as I can confirm the issue with the test document:
Ubuntu 14.04 x64
LibreOffice 4.4.0.3


Priority on this one is pretty hard but for now I'm sticking to the routine:

Minor - it can slow down professional quality work but will not completely prevent it.

High - It makes the particular feature almost unuseable in documents like this (2-3 minute delay). What makes it particularly troublesome is that it happens every time you use the font color drop down (the color pallete isn't stored at all so every time it regenerates the list which takes another 2-3 minutes)

As for a debug, I'll try to get something together.
Comment 13 Ron Johnson 2015-02-04 08:26:08 UTC
(In reply to Joel Madero from comment #12)
> I'm setting this to new as I can confirm the issue with the test document:
> Ubuntu 14.04 x64
> LibreOffice 4.4.0.3

Thanks, because with the greatly expanded palette size, Document Colors is a great idea.
Comment 14 Commit Notification 2015-02-14 00:42:30 UTC
Ursache Vladimir committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6a348503ad504a82778f86d35325737b712c5352

tdf#89004 improve performance of document data collection

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2015-02-14 00:42:36 UTC
Ursache Vladimir committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1e475fef47fe6bd9dba6d830aaf0b6c12dc88881

related tdf#89004 improve performance of document data collection

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2015-02-14 00:52:15 UTC
Ursache Vladimir committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e7672e9633d0fe23917a2a348e77808a40ae0942&h=libreoffice-4-4

tdf#89004 improve performance of document data collection

It will be available in 4.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2015-02-14 00:52:21 UTC
Ursache Vladimir committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5fb88fddb856f53e0b187a3cf2ca98c9b83e874c&h=libreoffice-4-4

related tdf#89004 improve performance of document data collection

It will be available in 4.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2015-02-14 14:56:30 UTC
Ursache Vladimir committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=50a36041e18dc2a595259b5414ded409687dc47b

related tdf#89004 move to std:set instead of std::vector

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 19 Joel Madero 2015-02-15 06:31:41 UTC
Verified on 4.5 master built today. Thanks for the quick fix!
Comment 20 Ron Johnson 2015-08-07 21:56:06 UTC
Works perfect in v5.0.0.5.  Thanks.