Poor performance in live preview mode

Steps to reproduce

open a note with a bunch of links/content in live preview

Expected result

live preview would not be laggy.

Actual result

live preview is noticeably laggy when 1) scrolling 2) typing.


with a note like this (attached at the end) that has a bunch of links, obsidian lags pretty severly in live preview. i checked devtools performance tab, and it is somewhere between 12-24ms each keypress. not unusable, but definitely noticable. i have an ASUS FX502VE gaming laptop, obsidian does run on hardware acceleration, however not on my nvidia GPU (overkill & drains a lot of battery), it runs on intel HD graphics.

i don’t think the gpu is the problem honestly, it more seems like live preview is not so well optimized - each kepress event calls some sort of an e.update function, which (i assume) updates elements, this is the culprit, taking somewhere between 9-12ms each keypress.

i know this is not an issue for everyone, because a lot of people have overspecced MacBooks, but i don’t think obsidian, an electron app, has any business running this poorly on a gaming laptop (albeit a few years older).

i would be glad to see more optimizations done in live preview - maybe virtualization (don’t render or update anything that’s not on screen) and some other types of optimizations too.

lastly, this is only prominent in Live preview. source view is fine and so it reading view. i have a 165hz 1440p monitor, if this info is needed. I have tried the same note in sandbox vault and the lag is still 80% there (still noticeable).

Environment

  • Operating system: windows 10, ASUS FX502VE
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.8
    Installer version: v0.14.6
    Operating system: Windows 10 Home 10.0.19044
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: off
    Legacy editor: off
    Base theme: dark
    Community theme: Willemstad v1.0.0-alpha-8
    Snippets enabled: 28
    Restricted mode: off
    Plugins installed: 29
    Plugins enabled: 18
    1: Minimal Theme Settings v6.1.1
    2: Sort & Permute lines v0.6.1
    3: Smarter Markdown Hotkeys v1.16.3
    4: Style Settings v0.4.12
    5: Dataview v0.5.47
    6: Sortable v0.2.6
    7: Settings Search v1.2.0
    8: Quick Switcher++ v2.3.5
    9: Excalidraw v1.8.6
    10: Focus Mode v1.11.4
    11: Kanban v1.5.1
    12: Advanced Tables v0.18.1
    13: Completed Task Display v1.0.3
    14: Highlightr v1.2.2
    15: Copy Block Link v1.0.4
    16: Templater v1.16.0
    17: Contextual Typography v2.2.4
    18: Emoji Shortcodes v2.2.0

Additional information

@interesting-links.md (7.7 KB)

The page works fine for me in sandbox vault.

download and reinstall obsidian.
Use restricted mode and default theme, restart obsidian.

  1. how can i make sure i don’t lose any data? just backup my valult, then uninstall & install again?
  2. where can i find “restricted mode”?

backup is always a good idea, but you don’t need to do anything just download and reinstall from the website, it won’t touch your vault.

In the community plugins settings.

i think it might’ve helped mitigate the issue - atleast partially. the lag is still present but barely noticeable, not as obvious now.
i would appreciate if obsidian devs did consider more optimization, especially for the live preview mode.
thanks for the quick reply.

1 Like