Bug 168696 - After Trace on Table with 100s of cells, edit becomes very slow
Summary: After Trace on Table with 100s of cells, edit becomes very slow
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:26.8.0
Keywords: haveBacktrace, perf
Depends on:
Blocks: Performance
  Show dependency treegraph
 
Reported: 2025-10-04 23:31 UTC by Ian Eales
Modified: 2026-02-02 14:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
file with problem (484.43 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-10-05 17:27 UTC, Ian Eales
Details
Perf flamegraph of file opening (542.45 KB, image/svg+xml)
2026-01-22 18:03 UTC, Buovjaga
Details
Perf flamegraph of tracing dependents (744.65 KB, image/svg+xml)
2026-01-28 16:48 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Eales 2025-10-04 23:31:57 UTC
Description:
After Dependent trace on cell into a table with about 37,000 cells with formulae in most cells, any operation on the workbook becomes exceedingly slow, taking about 40 seconds.

Saving and restarting LO does not help.
Rebooting the computer does not help.
There was ZERO problem with 

No other LO application that is open functions either.

I'm sorry I can't provide an example at this time as the data is proprietary.

Steps to Reproduce:
1. As above
2.
3.

Actual Results:
LO Calc is DOA for 45 seconds on ANY edit

Expected Results:
Quickly be able to enter formulae


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.6.2 (X86_64) / LibreOffice Community
Build ID: 729c5bfe710f5eb71ed3bbde9e06a6065e9c6c5d
CPU threads: 20; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 m_a_riosv 2025-10-04 23:52:45 UTC
How do you expect anyone can verify your comment.

Please attach a sample file.
Comment 2 Ian Eales 2025-10-05 01:28:29 UTC
How do I ensure that it's open to the whole world?
Comment 3 Ian Eales 2025-10-05 14:36:14 UTC
I've been working on this file for months. The data is proprietary.

In all likelihood, recreating the file may not show the issue.

I've submitted bugs that are still unresolved years later, but the files are available for anyone on the planet with a login to access.

I'll gladly submit the file to a secure location not available to everyone with an 
account.
Comment 4 Ian Eales 2025-10-05 17:27:49 UTC
Created attachment 203151 [details]
file with problem


Problem file attached.
Seems to me the Trace function adds a boatload to the file and does not clear properly when dealing with a large number of cells.

Cell AB2
Traced dependents.
File takes ≈45s to open or enter any formula.

Addition worksheets removed. Makes no difference.

File was about 110k larger than previous day saved backup.
Comment 5 m_a_riosv 2025-10-05 22:39:15 UTC
Well, disable the dependencies.
Do you really need to work with them enabled? There are thousands of dependencies, which makes for a difficult display.

Perhaps there could be a limit on the number of dependencies displayed?

BTW, there is an intensive use of INDIRECT(), that is a volatile function, that is recalculated every time a cell is change, precedent or not.
As example: 
AD27 = =INDEX($A:$ZZ;$AC27;5)

I'm not sure if it is really a bug.
Comment 6 Ian Eales 2025-10-05 23:03:14 UTC
When it corrupts the file making it unusable, it's a problem.

It happens when trace dependency is used into a single column of 1600 entries.


!!!!  THIS DID NOT HAPPEN IN PREVIOUS RELEASE 25.2.2.X  !!!!
Comment 7 Ian Eales 2025-11-12 16:41:36 UTC
Additionally, if a CLEAR trace is executed, while LO is attempting to show the traces, it's all over but the crying.

LO should put up an hourglass while tracing and disable additional TRACE options until complete.

The whole point of being able to trace is to find dependent / sources when things don't go as expected.

My current workbook as about 500,000 cells and it's by far from the largest.
200,000 cells can depend on a single cell.


If I have multiple documents open, they are all toast.


This is far more serious than NORMAL.
Comment 8 Ian Eales 2025-11-14 17:13:54 UTC
A suggestion:

Rather than drawing an arrow for every cell in a dependent / precedent array, how about ONE arrow and a box around the dest / source cells?

Would likely be several orders of magnitude faster.
Comment 9 Buovjaga 2026-01-22 15:33:00 UTC
(In reply to Ian Eales from comment #6)
> When it corrupts the file making it unusable, it's a problem.
> 
> It happens when trace dependency is used into a single column of 1600
> entries.
> 
> 
> !!!!  THIS DID NOT HAPPEN IN PREVIOUS RELEASE 25.2.2.X  !!!!

If this was referring to the opening time, then it's not true. I tested attachment 203151 [details] with several versions and the opening time has not regressed. Tested by launching from the command line with time OOO_EXIT_POST_STARTUP=1
Comment 10 Buovjaga 2026-01-22 18:03:49 UTC
Created attachment 205137 [details]
Perf flamegraph of file opening

Flamegraph of opening attachment 203151 [details]

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 4ca7291c939aaaf44ab8d7a9b0da8d407875a97a
CPU threads: 8; OS: Linux 6.18; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 11 Buovjaga 2026-01-22 18:05:04 UTC
Changing version to 7.0 as that was the earliest I tested the file opening time with.
Comment 12 Ian Eales 2026-01-24 17:34:43 UTC
It's not the opening time, it's the time to show dependencies.
Comment 13 Buovjaga 2026-01-28 16:48:48 UTC
Created attachment 205233 [details]
Perf flamegraph of tracing dependents

Flamegraph of doing Tools - Detective - Show Dependents while in cell AB2 of attachment 203151 [details]

Arch Linux 64-bit
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 3466a602ed80663cbe7982425219e64504b3eb75
CPU threads: 8; OS: Linux 6.18; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 27 January 2026
Comment 14 Commit Notification 2026-01-30 10:49:29 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7c539ecc3892f854d48fd33daffae8886fca3aee

tdf#168696 speedup trace dependants

It will be available in 26.8.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 15 Commit Notification 2026-01-31 07:51:26 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3eb70aae778d23799f53aac1fc76baaf9f1c42e6

tdf#168696 speed up hit testing a little on polygons

It will be available in 26.8.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 16 Noel Grandin 2026-02-02 12:14:24 UTC
I agree that we need a better strategy for drawing arrows when the numbers get high, probably merging destinations into a bounding box and having one arrow per destination bounding box would be good.

Doing that might be suitable as a G-Soc or similar project, it is mostly contained to one or two files in writer, and does not touch large amounts of our internal API.
Comment 17 Buovjaga 2026-02-02 14:37:13 UTC
(In reply to Noel Grandin from comment #16)
> I agree that we need a better strategy for drawing arrows when the numbers
> get high, probably merging destinations into a bounding box and having one
> arrow per destination bounding box would be good.
> 
> Doing that might be suitable as a G-Soc or similar project, it is mostly
> contained to one or two files in writer, and does not touch large amounts of
> our internal API.

Created bug 170570 and alerted UX.