Massive CPU usage incurred when scrolling a PDF - very long delay in opening files - blocked UI

Yes, checked guide and other reports first.

Yes, tested in completely generic vault, with no custom theme or snippets and all community plugins disabled.

When scrolling a PDF file that is already open or when opening a PDF file under conditions which would cause the PDF to be scrolled to specific page, in other words, whenever.

  1. the user interacts with the document viewer to scroll the document,
  2. the file is being opened via a link specifying the page number to scroll to, or
  3. Obsidian is opening a previously viewed document to the page it was on when last opened

the result is a very lengthy delay in completing the action, during which time the CPU is nearly fully spiked.

I expect to be able to open a PDF file without workflow destroying delay, in a period of time that rationally reflects the system resources actually required to do the task.

PDF files require many seconds, in many cases upwards of 30 seconds, to scroll and/or open and scroll, and these actions spike CPU to maximum available during that entire time. One typical example (300 page, image based PDF, about 50 MB in size) includes over 30 seconds to complete the task, which includes several multi-second operations and over 13 seconds of blocking time (non-responsive UI).

More detail in the help request thread at: PDF Peculiarities

The problem is experienced on all of my Windows-based Obsidian installations. I have not tried other environments. Sorry, not at console at moment to get requested environment info.

Ok, let’s wait until you are at your desktop and you file a proper bug report following the template.

Also, upload your pdf here using chrome If it is slow there, there’s nothing we can do.

Uploaded a variety of PDF to the given URL. Compared to performance of opening same files in Obsidian. In short, the online viewer spikes the CPU to about 25-30% compared to 75-80% in Obsidian. The task completes in 2-4 seconds, as compared to 20-30 seconds in Obsidian. Blocking time drops completely to 0, compared to 5-15 seconds in Obsidian.

Obviously, the only apples-to-apples test that could be conducted is with a file that is already open, manually instigating a scroll by moving the viewer’s scroll bar to a different place in the document… just to recall that this is only one of the three conditions that instantiate the problem when using Obsidian.

Not the file already open, you can upload your file. look at the top right corner.

I understood that. My very first sentence makes that clear. When I upload a file, and move the scroll bar, and measure its performance, I am using the same file locally. I am saying that, for example, there is no way for me to open a file to a specific page, using the online viewer.

Can you please post a screen recording of a file being slow to scroll in a obsidian and the same file scrolling in the link I provided?

Sure. That will take a little time.

Okay, don’t have the time right now to do a whole little vid, I can get it later if needed - but here are two screenshots that should make the difference clear - they show the same document being open in the online viewer and then being scrolled while chrome is making a performance recording. Then the same document being scrolled in Obsidian. As I described previously, the online version has no blocking time and scrolls (relatively) quickly at about 3 seconds. Whereas Obsidian has several second of blocking time and takes about 25 seconds for a similar scrolling task.

Hope it helps.

That’s not a screen recording. Can you upload the file somewhere and attach the link here. I’ll try it myself.

I’m happy to upload the file used in the screenshots… where would you like it since this forum doesn’t allow me to upload a PDF directly and fails to upload it when compressed to a zip? It’s about 130MB so perhaps too big for the forum software(?)

The problem however is not specific to any given file, which I attempted to make clear in my post, and is one which you should be able to easily reproduce yourself using any moderately sized PDFs of your choice, given that you have already been provided a more cogent problem statement with more investigation behind it than almost any trouble ticket you would be likely to receive. Work the issue or don’t, but read what I have already given you and make sure you understand it first. The issue isn’t in loading the file. It is moving to a new location in the file. It is made worse when files are larger, or multiple files are open; however, the screenshots you were given show the general scope of the issue with but a single file open.

Here is the file, screen recording, and screen captures from before.

In the screen recording, the problem is not as blatant as it typically is, but it is still highly noticeable.

I am unable to reproduce the problem and I do not notice any differences in the way the performance between Obsidian and pdf.js in chrome.

What are your computer specs exactly?

You do not notice? Seriously? The screenshots show you the blocking issue and the time differential. The video shows you it taking 17 seconds to open a file that the online viewer can open in a couple of seconds. It also shows you the online viewer moving to different locations in the file in 2-4 seconds while Obsidian takes 11. If you are doing your noticing on a sufficiently high end machine and relying on your eyeballs, it could be entirely the case that you don’t notice a difference. That’s why professionals use performance tracing and profiling tools, no?

Look, I don’t care if you improve your product. Do what you want, pretend the rest doesn’t exist, if that’s what works for you but In looking through these forums, I see that this is not the first time that almost certainly related issues have been raised and ignored. Apparently I am not the only one for whom you seem to have earned your sobriquet… I hear nothing from you but white noise. I won’t bother you again.

That PDF is heavy.

I don’t have an high end computer. It takes 6 second to first load the file and a couple of second tops to catch up if I scroll very fast. And it act exactly the same on chrome with pdf.js.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.