Bug 166284 - remove busy-timer in calc
Summary: remove busy-timer in calc
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2025-04-21 17:17 UTC by Michael Meeks
Modified: 2025-09-08 14:09 UTC (History)
2 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 Michael Meeks 2025-04-21 17:17:16 UTC
Calc has (hopefully) after https://gerrit.libreoffice.org/c/core/+/184414 the last busy-timer which sits and spins for no really good reason - checking things we could have known about earlier.

sc/source/ui/app/scmod.cxx

IMPL_LINK_NOARG(ScModule, IdleHandler, Timer *, void)

Does several things that should happen at 'idle' - and possibly its fair enough to have a timeout instead of a very low priority idle: that's not clear - but ... we should not be doing this all the time with this complex back-off timeout.

if 'bMore' is not true - we should stop the timer not back-it off.

We should audit the things that are done here - so eg. if:

        // While calculating a Basic formula, a paint event may have occurred,
        // so check the bNeedsRepaint flags for this document's views

the bNeedsRepaint flag is set and was not set before - we should re-queue the calc timer to do this work - but otherwise not run it - we don't want to burn CPU and power un-necessarily if there is no basic formula in use eg. =)

similarly for links & calculating text width and so on - we should queue the idle handler as/when there is some real change it could do some work and not otherwise.

Patch linked above is a similar fix for swapping out objects.

Thanks ! =)