dy-sh / obsidian-remember-cursor-position

Obsidian plugin. Remember cursor position for each note
MIT License
215 stars 14 forks source link

Unusually High StartUp Time #30

Open chrisgrieser opened 2 years ago

chrisgrieser commented 2 years ago

Using the "Debug StartUp Time" toggle, I noticed that every time I startup Obsidian, remember Cursor Position takes up the highest amount of ms for starting up out of all plugins I have installed (~50 plugins).

Remember Cursor Position takes up ~150ms; in comparison: dataview, one of the most resource intensive plugins, only requires 50ms on my machine.

I investigated a bit and it seems reading the remembered cursor positions is the culprit, deleting the respective json reduced to startup time of the plugin to nearly 0ms again.

dy-sh commented 2 years ago

Thanks for the research. Any ideas how this can be optimized?

chrisgrieser commented 2 years ago

Hmm. Maybe add a setting like "max age before deletion" for the remembered positions? My guess is that the amount of cursor positions accumulated for over a year just become too big.

dy-sh commented 2 years ago

You're right, that would be better.

digitalsignalperson commented 1 year ago

another filter could be: only remember cursor position for files longer than N lines

then for lots of small files where you don't have to scroll anyway, no need to save/restore