Closed RyotaUshio closed 2 months ago
Originally posted by @daknili in https://github.com/RyotaUshio/obsidian-pdf-plus/discussions/128#discussioncomment-9014699
First, thank you for this awesome plugin. Unfortunately I have the same problem as uoFishbox, but in my case the separate windows solution brings no relief. The issue in my case seems to be related to the file size of the pdf. I pretty much use the plugin to comment on entire books (> 10 MB) but the plugin gets quickly unusable. Disabling the plugin and then enabling it again somewhat helps. I'am on a Mac and performance degradation seems to be connected with high CPU usage of the Obsidian Helper (Renderer).
What is happening is something like this:
vault.on('modify', ...)
& metadataCache.on('changed', ...)
are firedmetadataCache.on('changed', ...)
event triggers the update of the PDFBacklinkIndex
:
https://github.com/RyotaUshio/obsidian-pdf-plus/blob/45ab81f3b8548c1989d8e7499bcb152301596038/src/lib/pdf-backlink-index.ts#L25-L28visualize()
method of PDFViewerBacklinkVisualizer
:
https://github.com/RyotaUshio/obsidian-pdf-plus/blob/45ab81f3b8548c1989d8e7499bcb152301596038/src/backlink-visualizer.ts#L237-L239
https://github.com/RyotaUshio/obsidian-pdf-plus/blob/45ab81f3b8548c1989d8e7499bcb152301596038/src/backlink-visualizer.ts#L253So it is likely that either (or both) of PDFBacklinkIndex.update()
or PDFViewerBacklinkVisualizer.visualize()
is consuming too much computational resources.
Thank you for your attention. Yes, the problem disappears if Highlight backlinks in PDF viewer is disabled.
After some investigation, it looks like this guy is the most performance-heavy.
A possible solution is to cache the results of this function so that we can reuse them.
I've just beta-released 0.39.14-beta0 (BRAT only). @uoFishbox @daknili Can you test it and give me some feedback if you have time?
Thanks for the new beta release.
Performance degradation when a PDF has many backlink highlights seems to have been almost completely resolved. I want to express my gratitude for this!
The phenomenon I posted previously, where the problem is greatly reduced when opened in another window, appears to be caused by the obsidian-livesync plugin.
It seems that about 60% of the performance degradation I was experiencing was caused by this plugin separately. (It is possible that my vault is too large. I will verify this on my end.)
Hello, I'm not familiar with installing beta plugins. Therefore, I installed the BRAT plugin and in the settings under the Add Beta plugin list I entered this address
https://github.com/RyotaUshio/obsidian-pdf-plus/releases/tag/0.39.14-beta0
But then the following message pops up
Is there anything I can do?
@daknili Thanks for trying! Use this URL instead, then it will work:
https://github.com/RyotaUshio/obsidian-pdf-plus
Yes, everything is fine now. Finally I'am able to work properly again. Your plugin is tremendously useful. Thank you!
Thank you guys for your contribution, this fix has been publically released as 0.39.14!
Discussed in https://github.com/RyotaUshio/obsidian-pdf-plus/discussions/128