Menu

#174 Selecting SVG equations with many elements very slow in Linux

v1.0_(example)
open
nobody
None
5
2023-11-05
2023-08-29
garden
No

Between 0.46 and 0.55.1 (the current version), SVG equations started to be written as many nodes in content.xml instead of as a single external .svg file under /Pictures. It is possible to view the difference in the structure at a high level with the visual LibreOffice Explorer pane.

The result of the change is that Linux takes from 5-10 seconds, depending on hardware and kernel, to select a simple equation with many repeating characters. A more complex equations can take almost a minute to select. This makes the extension unusable on Linux.

With a simple profiler (sysprof) it is possible to see that xorg is making many kernel memcpy calls and page faults in memcpy operations while LibreOffice is frozen and waiting for the extension to parse(?) the SVG.

I tested on 2 different Ubuntu 22.04 laptops and in Clear Linux. All were running xorg, gnome, and have default libreoffice and texlive packages.

PNG equations are not affected. Texmaths-0.46 is not affected probably because it creates a single SVG node for each equation.

Recompiling an equation created in 0.46 in the current 0.55.1 makes it slow.

Are there any LibreOffice or TexMaths settings that to mitigate this behavior? Would it be possible to force the extension to write each SVG as a file under Pictures directory as before?

I am attaching simple examples made by 0.46 and 0.55.1. The newer one is very slow to select in Linux.

2 Attachments

Discussion

  • garden

    garden - 2023-08-29

    Selecting the object in the LibreOffice Navigator pane is quick. Selecting the equation with the mouse pointer on the document canvas is slow.

    This may imply that the bug is in LibreOffice. The problem can be probably corrected much more easily by modifying TexMaths back to its previous SVG storage scheme than by fixing LO.

     
  • garden

    garden - 2023-09-02

    LO confirmed bug #156995 and added it as a blocker of #107810

    https://bugs.documentfoundation.org/show_bug.cgi?id=107810

    Some of the blockers date back to 2011 so this issue is not likely to be addressed soon by LO.

     
  • Roland Baudin

    Roland Baudin - 2023-09-06

    Hi, the slow selection problem is due to the conversion to curve of the graphic equation that is done since TexMaths 0.49.

    This conversion to curve:
    1) is needed for MS Office export
    2) allows to change colors using LibreOffice's UI

    I'm curious: do you really have so big equations? Could you send me some realistic example?

     
  • garden

    garden - 2023-09-06

    Here is one page from a presentation that contains many similar pages. The first equation is very slow to select in Linux (and not quick to de-select either) because it is drawn with curves in content.xml. Second equation is a PNG and is fast.

     
    • Roland Baudin

      Roland Baudin - 2023-11-05

      I reported the problem to the LO team.
      I also discovered that the problem is related to gtk3 rendering.
      If you launch Impress like this (with qt5 rendering, in Linux), then it is fast:

      SAL_USE_VCLPLUGIN=qt5 /opt/libreoffice7.6/program/simpress

       

Log in to post a comment.