Bug 73606 - High CPU use scrolling down ...
Summary: High CPU use scrolling down ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.3.0 target:4.2.1
Keywords: perf, regression
Depends on:
Blocks: mab4.2
  Show dependency treegraph
 
Reported: 2014-01-14 12:57 UTC by Michael Meeks
Modified: 2021-03-02 16:25 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2014-01-14 12:57:24 UTC
Create an empty spreadsheet, hold down the down arrow, notice the CPU usage jump to 50% or so.
Comment 1 Michael Meeks 2014-01-14 13:00:58 UTC
Callgrind profile at:

http://users.freedesktop.org/~michael/calc-scroll-down-profile.txt.bz2

Shows it is primarily in ScViewFunc::AdjustBlockHeight.
Comment 2 Kohei Yoshida 2014-01-14 14:10:03 UTC
Help me understand this.  Why is this a problem?
Comment 3 Michael Meeks 2014-01-14 14:21:18 UTC
It's quite a lot of CPU to use to scroll down =) I would expect to just draw a bit more, not do all that re-arrangement of the row height structures - surely there must be something silly happening there ? ...
Comment 4 Kohei Yoshida 2014-01-14 14:44:14 UTC
I'll look into this.
Comment 5 Commit Notification 2014-01-14 15:57:41 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#73606: Avoid excessive and unnecessary heap allocation of array objects.



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 6 Commit Notification 2014-01-14 16:52:34 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31533d47b24680f76e769949874d41f0fe27134f

fdo#73606: Avoid calling MarkDataChanged() when nothing is selected.



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 7 Kohei Yoshida 2014-01-14 16:53:36 UTC
I've made two changes.  Originally, my CPU usage was ~40%.  After the 1st change, it got reduced to 28%.  After the 2nd one it became 24%.  I'd say this is good enough improvement for now.
Comment 8 Kohei Yoshida 2014-01-14 16:55:28 UTC
Request for backport to 4.2 underway:

https://gerrit.libreoffice.org/7425
https://gerrit.libreoffice.org/7426
Comment 9 Kohei Yoshida 2014-01-14 17:02:52 UTC
(In reply to comment #7)
> Originally, my CPU usage was ~40%.

Actually it was more like 48%.
Comment 10 Kohei Yoshida 2014-01-14 17:46:26 UTC
Interesting. With 4.1 I only get 16% CPU usage on scrolling.
Comment 11 Commit Notification 2014-01-15 17:37:06 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

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

fdo#73606: Avoid excessive and unnecessary heap allocation of array objects.


It will be available in LibreOffice 4.2.1.

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 12 Commit Notification 2014-01-15 17:38:24 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

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

fdo#73606: Avoid calling MarkDataChanged() when nothing is selected.


It will be available in LibreOffice 4.2.1.

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 13 Kohei Yoshida 2014-01-15 17:40:44 UTC
I'll call this fixed.