foambubble / foam

A personal knowledge management and sharing system for VSCode
https://foambubble.github.io/
Other
15.28k stars 650 forks source link

Foam v0.25.9 very slow #1345

Closed ktrNozomi closed 6 months ago

ktrNozomi commented 6 months ago

Describe the bug

When in Vim mode (either Vim extension or VSCode Neovim extension), enter :w to save the current editing file, and the file will not respond to any key strokes.

I uninstalled Foam extension, the problem doesn't exist. I returned back to Foam v0.25.8, the problem doesn't exist.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

See the bug description.

Expected behavior

After saving the file, the editor should respond to key strokes normally.

Screenshots or Videos

No response

Operating System Version

Windows 11

Visual Studio Code Version

1.87.2 User mode

Additional context

No response

ais commented 6 months ago

It takes 2 – 5 seconds to save a file after #1344. I assume this is why input is blocked when the Vim extension is enabled.

See also: https://github.com/foambubble/foam/pull/1344#issuecomment-2002710516

riccardoferretti commented 6 months ago

Thanks for reporting the issue, I will push the fix right away (silly bug)

riccardoferretti commented 6 months ago

I just pushed v0.25.10 - let me know if you are still experiencing the problem. Will close the issue if the problem is gone

ais commented 6 months ago

v0.25.10 seems to have made it worse for me. My inputs are blocked on saving now even when I am not using the Vim extension, even tho the file seems to save immediately now. Code is using 30% CPU during this time; thrice as much as patch 9.

riccardoferretti commented 6 months ago

Can you check what happens if you revert to 0.25.8 ? Does that solve the issues you are having?

ktrNozomi commented 6 months ago

@riccardoferretti after updating to v0.25.10, the key stroke responds normally; but I see as @ais said, the same situation happens to me -- the CPU increased to 30% after saving the file. But this doesn't influence the fluency on my machine, my CPU is AMD R7 5850U.

riccardoferretti commented 6 months ago

@ktrNozomi can you also do the comparison with 0.25.8? Just wanna be sure that in the meantime something hasn't changed in VS Code that instead seems related to the extension (this happened in the past). Can you and @ais please:

  1. check the current state with 0.25.10
  2. revert the extension to 0.25.8
  3. compare the resource utilization
  4. let us know :)

I am saying this because, beside the bug I introduced, the changes should not have performance implications. There might be another more subtle bug, looking into it

ktrNozomi commented 6 months ago

@riccardoferretti after testing, it seems that v0.25.8 has no problem and v0.25.10 has performance issue.

This is v0.25.8: v0 25 8

This is v0.25.10: v0 25 10

ais commented 6 months ago

I reverted to 0.25.8 shortly after my last comment as an immediate solution, and haven't experienced any issues with it. CPU usage never goes above 3%.

I haven't updated Code recently; I'm running v1.85.2 (2024-01-18).

riccardoferretti commented 6 months ago

Ok thx, will look into it

riccardoferretti commented 6 months ago

Ok, I think I have found the actual problem and pushed 0.25.11 which should have addressed it. @ais @ktrNozomi can you please let me know if things get better?

ktrNozomi commented 6 months ago

Ok, I think I have found the actual problem and pushed 0.25.11 which should have addressed it. @ais @ktrNozomi can you please let me know if things get better?

Thanks a lot for your work! Now everything works fine on my machine. Thanks @ais too for finding bugs!

riccardoferretti commented 6 months ago

Thank you both for bringing it up to my attention, cheers!