Bug 155349 - Writer collaborative performance regression problem in 7.5
Summary: Writer collaborative performance regression problem in 7.5
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.4 target:7.6.0
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-16 09:03 UTC by Miklos Vajna
Modified: 2023-05-22 09:46 UTC (History)
5 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 Miklos Vajna 2023-05-16 09:03:37 UTC
We got reports that collaborative editing (multiple views, via LOK/Online) performance is much worse in 7.5, compared to what we had in 7.3.

A first find from Caolan is:

> my bafflement that I see this hit on every keystroke in trunk is explained by std::move() and std::optional because std::move on a std::optional do not leave behind an "unset std::optional"  https://stackoverflow.com/questions/51805059/why-does-moving-stdoptional-not-reset-state
> 
> std::optional<SwRegionRects> TakePaintRegion() { return std::move(m_oPaintRegion); }
> 
> from
> 
> commit bf09ac2981ea1e6ee9aa1c6c3c94299a8b9ec2de
> Author: Noel Grandin <noelgrandin@gmail.com>
> Date:   Thu Aug 18 21:00:25 2022 +0200
> 
>     unique_ptr->optional in SwViewShellImp
> 
> where it used to be std::unique_ptr which would be left behind in an empty state after the std::move

This bug is document findings related to this perf problem.
Comment 1 Caolán McNamara 2023-05-16 09:07:29 UTC
Steps to reproduce this in trunk is the
SAL_INFO("sw.idle", "Disappointing full document invalidation");
in sw/source/core/layout/layact.cxx I see that on every key press
that is triggered
Comment 2 Commit Notification 2023-05-16 10:20:41 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#155349 std::move of a std::optional leave behind a set std::optional

It will be available in 7.5.4.

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 3 Commit Notification 2023-05-16 12:08:54 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1a3bfd3af113da246b0327e5cc816542682f90ba

tdf#155349 std::move of a std::optional leave behind a set std::optional

It will be available in 7.6.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 4 Caolán McNamara 2023-05-16 19:56:21 UTC
sw/qa/extras/uiwriter/data/tdf104649.docx FWIW is an example of a document that does trigger "Disappointing full document invalidation" in the desktop case, but curiously no in the inline case so I think that might be worth investigating for why one differs to the other there.
Comment 5 Commit Notification 2023-05-19 08:00:21 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/669b95e6c99f9fc0ade7c23322b7142ef497133b

Related: tdf#155349 drop SetEndActionByVirDev from the html import

It will be available in 7.6.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 6 Commit Notification 2023-05-21 14:06:36 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#155349 add a test case to catch if full invalidation ever returns

It will be available in 7.6.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 7 Caolán McNamara 2023-05-22 09:46:42 UTC
This specific regression case is fixed, I'll open a new bug if there's something else to change.