Bug 128402 - Mouse moves produce unneccessary system load in a spreadsheet with lots of comments
Summary: Mouse moves produce unneccessary system load in a spreadsheet with lots of co...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace, perf
Depends on:
Blocks: Calc-Comments Performance
  Show dependency treegraph
 
Reported: 2019-10-26 08:59 UTC by b.
Modified: 2022-11-13 13:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
120k_commented_cells_6_2_8_2_win_x64 (957.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-11-26 00:42 UTC, b.
Details
Perf flamegraph (111.17 KB, image/svg+xml)
2020-06-16 18:26 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b. 2019-10-26 08:59:42 UTC
Description:
derived from working on poor performance with lots of notes / comments in a sheet, i have two observations / questions: 

- feel free to split into different bugs - 

1. 'hovering' with the mouse over a sheet (just moving the pointer) produces impressive system load once the sheet contains lots of comments (notes, change-notes), afaik it's resulting form recalculating which graphical objects to show. 

'shortcoming': it looks as if these calculations are done on *every* single small move, thus producing very high load. 

(especially on high-res systems?) 

enhancement proposal: some things (as to show the pointer at the new location) are neccessary, others (as to recalculate the comment display and rearranging hidden copies needed for copy and paste actions) are not! neccessary unless the pointer switches to another cell. thus most of the load could be omitted by evaluating whether the cell is left when the mouse moves, and depending on that either process the whole overhead, or just rearrange the mouse pointer.


2. the same thing happens when 'hovering' over 'not selected' windows running calc. it results in 'evaluation' of the action within that sheet, e.g. showing / hiding comments ... 

is that the desired behaviour? imho the active / selected window should interact with the user, while other windows remain 'passive' (they may do some work, ok, but to interact with the user (mouse) normally they have to be activated (selected) first). 

it is nice to have, e.g. usage hints when hovering over the toolbar, and the impact of recalculating comments might be neglectable if problem 1. above could be reduced. 

Steps to Reproduce:
1. produce a sheet with plenty - 5000+ - commented cells, 
2. move the mouse over that sheet, 
3. observe massive system load, with taskmanager on win or 'top' on lin, 
4. move the mouse within the borders of one single cell, 
5. observe the same system load, 
6. confirm above observations, 
7. for cross-check do the same with a sheet without comments, 


Actual Results:
massive system load, 

Expected Results:
less load, as no calculations are neccessary, 


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.0.0.alpha1 (x64)
Build ID: cc57df8f942f239d29cb575ea5a7cb01405db787
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc:
Comment 1 b. 2019-11-12 10:34:01 UTC
actual observations: 

the probems had been significantly better in ver. 6.2.7.1 for win (x64), 

(not better problem, but working better), 

it had not been solved in that version, but reduced to a usable state, 

in ver. 6.4.0.0a1 it's a 'better problems' again, i guess the performance loss has about doubled. 

i hope that the information will help to narrow down the source of the evil by comparing the versions.

observations: 

fresh loaded file with 40k commented cells: 

in 6.2.7.1 win (x64): 

'little' system load when circling around with the mouse, about 3 to 4% (task-manager), 
!! thats about 25% of the max. of 12% what calc is able to take on a 8 core system !!, 
doubled to 4 to 8% after 'save a copy', 

nearly no delay of the 'focus' (selected cell) following a mouseclick, 
little delays to see after 'save a copy', 


in 6.2.7.1 lin: 

stopped testing after incredible delays just with 10k commented cells, 


in 6.4.0.0a1

'medium' system load when circling around with the mouse, about 8%, 
increased to 12% after 'save a copy', 12% is max load calc can take, 

little delay of the 'focus' (selected cell) following a mouseclick on a loaded file, about 1 sec. delay per 10k cells when you create them in a fresh document,  
increased to 4 seconds (10k cells) to 10 seconds (40k cells) delay after 'save a copy', 

derivations - assumptions: 

there is a difference in handling between win and lin, once found it's possible to improve the other platform, 

there are superfluous calculations for mousemoves, 

there are superfluous calculations for commented cells, 

the bad influence worsens after every backup of the file, both 'save' and 'save as', as well as 'save a copy' increase the performance losses, there is probably an ineffective handling of the data. 

anybody fit enough to 'take that'? 

reg. 



b.
Comment 2 Xisco Faulí 2019-11-25 15:58:02 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 3 b. 2019-11-26 00:42:11 UTC
Created attachment 156113 [details]
120k_commented_cells_6_2_8_2_win_x64

hi, 

i've given that script quite often now, as you ask ... a file: 

try to load the attached sh.t, pardon sheet, be careful, your system might freeze, save unsaved work beforehand. 

(6.2.8.2 winx64 could handle, slow but could, 6.2.8.2 linx64: frozen)

be happy if it doesn't (freeze), 

if it does (freeze) try with handmade clone how big area your system can handle. 

script: 

' simple stresstest for LO calc handling big amounts of commented cells, 
A1: '1', add comment '2', (without the quotes) 
B1: '2', add comment '1', (without the quotes)
copy and paste B1 to A2, 
copy and paste A1 to B2, 
copy this 2x2 array and paste to a larger area, start with 2,5 k cells (A1:AX50), 

watch system load (win:task-manager 'Leistung', lin: 'top') on any activities as save, 'save as' and load file, copy and paste in the sheet ...  especially: simply moving the mouse over the sheet - also without the window with the sheet not active / selected - produces impressive system load. 

have fun! 

reg. 



b.
Comment 4 QA Administrators 2019-11-26 03:32:26 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2020-06-16 18:26:50 UTC
Created attachment 162070 [details]
Perf flamegraph

Took a perf trace while hovering wildly on Linux.

I'm not sure how to compare the CPU use, but it seems much higher on Linux than on Windows.

Arch Linux 64-bit
Version: 7.1.0.0.alpha0+
Build ID: 43bdac0ebd65dfc32a0b8cf2c42fde88ad585e3f
CPU threads: 8; OS: Linux 5.7; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 15 June 2020
Comment 6 Buovjaga 2020-06-16 18:28:09 UTC
Load looks the same in 6.3 on Linux
Comment 7 b. 2020-06-17 03:12:08 UTC
(In reply to Buovjaga from comment #5)
...  
> I'm not sure how to compare the CPU use, but it seems much higher on Linux
> than on Windows.
... 

i'm not an expert with this, conclusions from experiments: 

windows standard tool: task-manager, 

linux standard tool: top, 

difference: handling of multi core cpus, different percent reference, 

eight core machine, one core full load, 7 cores idle: 
task-manager: 12,5 %, top: 100 %, 

eight core machine, all cores full load: 
task-manager: 100 %, top: 800 %, 

thus values in linux are higher, but load is similar, 

hovering with the mouse: two to three cores engaged, one little, one about 40% (of core), one about 60%, summa 12,5% shown in task-manager resp. 100 % shown in top.
Comment 8 Buovjaga 2022-05-12 11:29:12 UTC
Load still looks same

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 32714f966186d301435d3eb9f7f6950bc9a6bb1e
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded