RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
165 stars 6 forks source link

Heavy performance hit to rendering equations after Obsidian is running for a while #186

Closed xieve closed 10 months ago

xieve commented 11 months ago

After running and using Obsidian for a few minutes, each render of any equation progressively gets slower, to the point where I have to type in equations "blindly" because the entire application locks up for several seconds to tens of seconds. This issue does not occur when Math Booster is deactivated. Here's a screenshot of a profiling run where I typed into an equation while this issue was occurring. I'm not sure about posting entire profiles publically, but maybe I could submit it privately somehow? image

Here's my debug info:

SYSTEM INFO:
    Obsidian version: v1.4.16
    Installer version: v1.4.16
    Operating system: Windows 10 Pro 10.0.19045
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: light
    Community theme: none
    Snippets enabled: 1
    Restricted mode: off
    Plugins installed: 35
    Plugins enabled: 9
        1: Excalidraw v1.9.24
        2: Auto Link Title v1.4.1
        3: MathLinks v0.4.6
        4: Dataview v0.5.61
        5: Extended MathJax v0.4.1
        6: Advanced Tables v0.19.1
        7: Templater v1.16.4
        8: Commander v0.5.0
        9: Latex Suite v1.8.4
        10: Math Booster v1.0.4
RyotaUshio commented 11 months ago

Hi, thanks for reporting.

The current implementation of the updating process of equation numbers and informChange (which is a part of MathLinks) are quite inefficient, and I suspect this is the cause of your problem. I'm planning to rewrite it to improve performance, and it might resolve the issue.

Sorry for the inconvenience, but please wait for the next release!

RyotaUshio commented 11 months ago

@xieve Probably I will be able to have time to implement a partial fix to this on this weekend. Could you send me the profile to ushio@ms.k.u-tokyo.ac.jp ?

RyotaUshio commented 10 months ago

Hey @xieve, if you're interested, try the alpha release 2.0.0-alpha and let me know how much it helped. Of course, there are still a lot of things I can do to improve performance; it's just a work in progress.

RyotaUshio commented 10 months ago

Now version 2 is officially available from the community plugins browser in Obsidian. I think it's way more performant than version 1 and your problem will be resolved. I'm closing this issue, but feel free to open a new issue if you encounter a similar performance hit with version 2.