Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writer performance with lots of users #6511

Closed
mmeeks opened this issue Jun 2, 2023 · 14 comments
Closed

Writer performance with lots of users #6511

mmeeks opened this issue Jun 2, 2023 · 14 comments
Labels
23.05 bug Something isn't working performance Improving COOL performance

Comments

@mmeeks
Copy link
Contributor

mmeeks commented Jun 2, 2023

Seems we get some performance problems - with new users joining (perhaps).
perf.txt

Seems there are a number of issues here: rendering styles, compressing bitmaps and so on.

@mmeeks mmeeks added bug Something isn't working unconfirmed labels Jun 2, 2023
@timur-g timur-g added 23.05 and removed unconfirmed labels Jun 2, 2023
@eszkadev
Copy link
Contributor

eszkadev commented Jun 2, 2023

related commit:

commit 522bde9470bbb321813fa5f1ca8e3c2ebb1bb5cc
Author: Szymon Kłos szymon.klos@collabora.com
Date: Tue Dec 14 18:21:39 2021 +0100

Update styles previews in Idle

https://cgit.freedesktop.org/libreoffice/core/commit/?id=522bde9470bbb321813fa5f1ca8e3c2ebb1bb5cc

have to check why we start that timer very often

@mmeeks mmeeks added the performance Improving COOL performance label Jun 2, 2023
@eszkadev
Copy link
Contributor

eszkadev commented Jun 2, 2023

patch trying to cache our style preview renders: https://gerrit.libreoffice.org/c/core/+/152556

@mmeeks

This comment was marked as outdated.

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 5, 2023

Weirdly that trace spends lots of time in 'load' which seems very unexpected for a plain text document with next to nothing in it ;-) In fact the trace above is for a completely un-related process not doing editing (it seems).

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 5, 2023

And a better trace - with a few users editing minutes etc, in a debugging build etc. etc. we really need to profile a proper release build on a demo server I think
perf-editing.txt
Here is that as a flame-graph:
perf
Which looks much more sensible - at least we're not spending lots of time style preview rendering =)

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 5, 2023

Curious - reading the profile more - it seems we spend quite a lot of time sending entirely new keyframes to the client, and not building/sending the (much smaller) deltas; which is rather curious. It would be useful to look at the tripple-click help accounting in each tile for which tiles are getting new keyframes instead of deltas: there should be counts in each. Screenshot appreciated @timar =)

@caolanm
Copy link
Contributor

caolanm commented Jun 6, 2023

FWIW, this is what I get on a trying to record from start of pseudo-join of 15 new users on the asan staging server until things become responsive again.

perf staging 31a74f75+bc44bc4

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 7, 2023

New trace from today's call.
online-perf-2023-06-07
Looks rather unexpected

@caolanm
Copy link
Contributor

caolanm commented Jun 7, 2023

https://gerrit.libreoffice.org/c/core/+/152719 is an idea for the OutputDevice::DrawTransparent issue which might work out

@caolanm
Copy link
Contributor

caolanm commented Jun 7, 2023

perf staging post-tokenize_foreach

Update of a simulated multi-user join with the newly shrunk removeCallbackDuplicate, but I still see some style preview generation which is annoying. Interacting with the 1st session while the others join seems to be able to trigger the notebookbar to be destroyed and replaced (tdf#155720) which clears that style preview cache.

https://gerrit.libreoffice.org/c/core/+/152720 to workaround that and #6547 to elide a few more std::strings ctors

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 7, 2023

Nice work =)

tdf-gerrit pushed a commit to LibreOffice/core that referenced this issue Jun 8, 2023
due to oddities related to tdf155720 the notebookbar the cache is hooked
to can be torn down and replaced if the 1st session is interacted with
while multiple other users join. So count goes to 0 just at the wrong
time to trigger throwing away the cache and forcing regeneration.

An Idle doesn't suffice here.

https: //github.com/CollaboraOnline/online/issues/6511
Change-Id: I148c99115fc497e34bf8920b6f59adc47605b8a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152663
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
tdf-gerrit pushed a commit to LibreOffice/core that referenced this issue Jun 9, 2023
due to oddities related to tdf155720 the notebookbar the cache is hooked
to can be torn down and replaced if the 1st session is interacted with
while multiple other users join. So count goes to 0 just at the wrong
time to trigger throwing away the cache and forcing regeneration.

An Idle doesn't suffice here.

https: //github.com/CollaboraOnline/online/issues/6511
Change-Id: I148c99115fc497e34bf8920b6f59adc47605b8a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152720
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
@caolanm
Copy link
Contributor

caolanm commented Jun 15, 2023

What todays save looked like save

And join, as a png for size reasons here join

@mmeeks
Copy link
Contributor Author

mmeeks commented Jun 15, 2023

Oooh - save performance is dominated by the thumbnail generate; and yet - that could easily run safely in another thread while the rest of the real save is going on - surely ? =)
That thing is also single threaded which is unexpected; normally our large scale-downs (and we do have to render it big and then scale it down) - are threaded surely ? not sure what's up there.
But I guess the larger win would be if we could do "thread thumbnail compression while saving" in the background I think =)

@mmeeks
Copy link
Contributor Author

mmeeks commented Jul 10, 2023

Seems like we fixed the lots-of-joiners problem; and the style preview bits - and also killed the big invalidations on new users joining - which is great =)

@mmeeks mmeeks closed this as completed Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
23.05 bug Something isn't working performance Improving COOL performance
Projects
Archived in project
Development

No branches or pull requests

4 participants