online icon indicating copy to clipboard operation
online copied to clipboard

Generic 24.04 Calc performance ticket

Open caolanm opened this issue 1 year ago • 65 comments

Lets track 24.04 separately than earlier releases wrt flamegraph results

caolanm avatar Mar 19 '24 12:03 caolanm

perf-31964

Todays calc 24.04 flamegraph

caolanm avatar Mar 19 '24 12:03 caolanm

Todays's calc 24.04 flamegraphs

perf-2784

perf-4121

caolanm avatar Mar 21 '24 12:03 caolanm

perf-25018

part of todays 24.04 calc test

caolanm avatar Mar 26 '24 12:03 caolanm

Well hello collectAutoStyles(), my old friend - I remember having a bash at this one, with not much success.

However, I can do something about ScDocument::GetColDefault, over here: https://gerrit.libreoffice.org/c/core/+/165346

grandinj avatar Mar 26 '24 13:03 grandinj

perf-6669

todays 24.04 calc session

caolanm avatar Apr 02 '24 11:04 caolanm

perf-16185

todays scheduled 24.04 calc profile

caolanm avatar Apr 04 '24 10:04 caolanm

Surprisingly unbalanced re: this UpdateCursorOverlay thing ... GetRectsAnyFor should not take that sort of time clearly - for what is ultimately only a few rectangles; looks like a substantial 2x+ perf. regression in the making.

mmeeks avatar Apr 04 '24 12:04 mmeeks

If the spreadsheet involved had a lot of overlapping/hidden/merged cells, that would explain the time spent in GetRectsAnyFor. Unfortunately, the code involved in overlapping/hidden/merged does not look easily improved.

grandinj avatar Apr 04 '24 12:04 grandinj

perf-28863

Todays ad hoc spreadsheet test

caolanm avatar Apr 16 '24 11:04 caolanm

Todays scheduled call with 24.04

perf-7758

caolanm avatar Apr 18 '24 10:04 caolanm

perf-13632

^^^calc 24.04 session with background save enabled^^^

perf-15060

^^^calc 24.04 session with background save disabled^^^

caolanm avatar Apr 19 '24 10:04 caolanm

perf-31576

^^^calc 24.04 session with background save enabled^^^

caolanm avatar Apr 23 '24 12:04 caolanm

perf-4357

calc 24.04 session

caolanm avatar Apr 25 '24 10:04 caolanm

perf-24580

todays calc 24.04 session, background saved are merged under a single kitbgsav

caolanm avatar May 09 '24 10:05 caolanm

perf-27282

Tuesday calc 24.04 profiling session, with mostly automated users

caolanm avatar May 14 '24 11:05 caolanm

I did a retest of https://github.com/CollaboraOnline/online/issues/8570#issuecomment-2031853407 with just the watchdog profiler active and did some full column copy and pastes from out typical calc testing document

The amount of break iterator loading looks odd, GetScriptTypeOfLanguage etc.

I wonder if we really need to figure out the area affected in UpdateAutoFillOverlay to send to online via LOK_CALLBACK_CELL_AUTO_FILL_AREA of it we could send an address there instead f.e

caolanm avatar May 15 '24 13:05 caolanm

Surely we can have a one item cache, or somesuch for: SvtScriptType GetScriptTypeOfLanguage( LanguageType nLang ) =)

mmeeks avatar May 15 '24 13:05 mmeeks

That flame graph looks suspiciously like a debug build.....

grandinj avatar May 15 '24 13:05 grandinj

objdump -Wi /opt/collaboraoffice/program/libuno_sal.so.3|grep DW_AT_producer gives....

GNU C++20 12.2.1 20221121 (Red Hat 12.2.1-4) -mtune=generic -march=x86-64 -ggdb2 -O2 -std=c++20 -fvisibility=hidden -finput-charset=UTF-8 -fmessage-length=0 -fno-common -fstack-clash-protection -fcf-protection=full -fstack-protector-strong -fvisibility-inlines-hidden -fPIC -fexceptions -fno-enforce-eh-specs

and similar for coolwsd itself

caolanm avatar May 15 '24 13:05 caolanm

Then I am guessing that o3tl::strong_int<T>:anyOf is not being compiled properly on that platform, for some reason, because it should definitely turn into just a handful of immediate instructions.

In which case we should change we should change MsLangId::getScriptType to use explicit if/then statements instead of o3tl::strong_int<T>::anyOf

grandinj avatar May 15 '24 13:05 grandinj

perf-32127

Todays calc weekly session, online commit: https://github.com/CollaboraOnline/online/commits/cd9875ec core commit: https://git.libreoffice.org/core/+log/07c93a6

coolwsd.xml contains: <background_autosave desc="Allow auto-saves to occur in a forked background process where possible." type="bool" default="false">true</background_autosave>

I wonder why I don't see kitbgsav in this session

caolanm avatar May 16 '24 10:05 caolanm

perf-60263

background save as expected

https://git.libreoffice.org/core/+log/421ef05 https://github.com/CollaboraOnline/online/commits/1b586a5

caolanm avatar May 21 '24 11:05 caolanm

Hmm - that trace has 40% of the save time in the foreground - which is unexpected; we should have one non-background save at exit but ... =) Still no sign of: "WRN Failed to ensure we have just one, we have: 2| kit/Kit.cpp:1388" in the logs since the 17th which is good; prolly nailed that then.

mmeeks avatar May 21 '24 15:05 mmeeks

perf-21330

todays scheduled calc testing profile

caolanm avatar May 23 '24 10:05 caolanm

Feedback was very positive on copy/paste today thanks @grandinj =) Digging into the 'GetOptimalHeight' code-path there I see that (oddly) there seems to be an explicit call to OutputDevice::GetTextWidth as a child of GetOptimalHeight which looks like something we could loose easily ? =) And I wonder if there are other height-not-width optimizations we could do there somehow. Anyhow - glad its feeling better :-)

mmeeks avatar May 23 '24 10:05 mmeeks

there seems to be an explicit call to OutputDevice::GetTextWidth as a child of GetOptimalHeight which looks like something we could loose easily ?

Fix (I think) here: https://gerrit.libreoffice.org/c/core/+/167988

grandinj avatar May 23 '24 13:05 grandinj

perf-13757

Todays devel version

caolanm avatar May 28 '24 11:05 caolanm

perf-258206

Todays stable version

caolanm avatar May 28 '24 11:05 caolanm

perf-349039

profile taken during calc testing while I wasn't present, so I'm not sure about this one, but I'll put it here anyway

caolanm avatar May 30 '24 13:05 caolanm

perf-18582

Tue test of devel version

caolanm avatar Jun 11 '24 10:06 caolanm