obsidian-core-search-assistant-plugin icon indicating copy to clipboard operation
obsidian-core-search-assistant-plugin copied to clipboard

Large & sustained increase in CPU usage on Obsidian Helper (Renderer) process

Open robin3 opened this issue 2 years ago • 14 comments

I'm seeing a large & sustained increase in CPU usage on the "Obsidian Helper (Renderer)" process when this plugin is enabled.

On my Mac (16" 2021 M1 Max MacBook Pro, MacOS 12.1)

With Core Search Assistant disabled:

  • The baseline CPU % for this process is usually <1% while Obsidian is in the background
  • This briefly increases to between 2 - 40% when searching, but then shrinks back to <1% after search is completed

With Core Search Assistant enabled

  • Baseline % is still usually <1%
  • % increases to 40 - 110% during search with card view enabled
  • After the search is finished, and a single note is displayed, the process stays >40%, in a range between 40% - 110%

I've tried repeatedly restarting Obsidian and enabling / disabling this plugin. The behaviour replicates every time.

robin3 avatar Jan 25 '22 18:01 robin3

@robin3

Thank you for reporting! I'll examine the problem later.

qawatake avatar Jan 26 '22 05:01 qawatake

@robin3

I think I have fixed the problem. Could you try it again? https://github.com/qawatake/obsidian-core-search-assistant-plugin/releases/tag/0.3.3

qawatake avatar Jan 26 '22 10:01 qawatake

Updated to 0.3.3, restarted Obsidian, and the same problem is still there.

Obsidian Helper (Renderer) process stays in the range 40% - 110% after the search is completed & a single note has been selected; and even after Obsidian is a background application (e.g. as I type this reply in Safari, Obsidian Helper is still consuming 105% CPU)

robin3 avatar Jan 26 '22 11:01 robin3

@robin3

I also checked CPU usage in my machine. The results are as follows:

  1. background
    1. no Core Search Assistant: 0.1%
    2. card view: 0.1%
  2. foreground
    1. no Core Search Assistant: 0.9%
    2. no auto preview: 0.7%
    3. single view: 16%
    4. card view: 16%

So I couldn't reproduce your result in the background, but confirmed a high CPU usage in the foreground. I'll investigate the problem further.

qawatake avatar Jan 27 '22 07:01 qawatake

@robin3

I think I have fixed the problem. Could you try it again? https://github.com/qawatake/obsidian-core-search-assistant-plugin/releases/tag/0.3.5

qawatake avatar Jan 28 '22 04:01 qawatake

@qawatake please can you push 0.35 to release so that I can install it via BRAT?

robin3 avatar Jan 28 '22 10:01 robin3

@robin3

I released 0.3.5.

qawatake avatar Jan 28 '22 10:01 qawatake

@qawatake I don't know why, but BRAT seems unable to upgrade from 0.34 to 0.35. I've tried restarting Obsidian multiple times, and manually uninstalling Search Assistant from BRAT and then reinstalling - but it's staying on 0.34

Screenshot 2022-01-28 at 10 31 18 .

robin3 avatar Jan 28 '22 10:01 robin3

@robin3

I'm sorry, I forgot to merge to main branch. It is necessary for BRAT to detect new releases.

qawatake avatar Jan 28 '22 10:01 qawatake

@qawatake Still stuck on 0.34, even after fully uninstalling and reinstalling, multiple restarts etc.

robin3 avatar Jan 28 '22 10:01 robin3

@robin3

I'm sorry again. I just released 0.3.5.

qawatake avatar Jan 28 '22 10:01 qawatake

@qawatake Thanks. It has updated to 0.3.5

0.3.5. is a big improvement - but there is still elevated CPU usage from that process even when Obsidian is a background window (hovering between 3 - 6%)

It's >8% when Obsidian is the active window, with a single note displayed, after completing a search

robin3 avatar Jan 28 '22 14:01 robin3

@robin3

I also confirm that cpu usage after searching with Core Search Assistant is 3-5% higher than the one before search. But I could not reproduce your result in the background. I'm investigating the cause now.

BTW, the problem about high cpu usage that you originally mentioned seems to be due to Obsidian itself. Live Preview causes obsidian to use 30-40% CPU when idle - Bug reports - Obsidian Forum

qawatake avatar Jan 29 '22 13:01 qawatake

@robin3

It seems that the cause is not this plugin itself. If you open files in new panes, CPU usage will increase and stay high even after closing them.

qawatake avatar Feb 11 '22 13:02 qawatake