Open lusqua opened 1 month ago
Having same issue... Fix it!
I think this is normal, esbuild's work is CPU-intensive and it will get the job done as fast as possible. The workload of the plugin doesn't affect the main VSCode process and UI, because VSCode uses a multi-process architecture where plugins run in separate processes.
One improvement I could make would be to make the computation on-demand, such as hovering or focusing on the corresponding reference statement to start the computation, which could take some time.
I haven't seen the code, but isn't caching a good option?
@lusqua Caching is enabled by default (kept in memory, see the settings of bundleSize.cache
) and each import is bundled only once.
I encountered a significant issue with high CPU usage while using your extension. The problem became particularly noticeable after I started working on a large codebase ( 528.088 lines of code ) . Specifically, I noticed that my CPU usage spiked to 95% when running ESLint. Upon further investigation using ps aux, I found that the esbuild process associated with your extension was consuming a large amount of CPU resources.
Here's the output from
ps aux | grep esbuild
:After disabling the extension, the CPU usage returned to normal. I am attaching a screenshot for your reference, where you can see the CPU usage spike (marked in red) and the normal CPU usage after disabling the extension (marked in green).
System Info:
Given the hardware I am using, such high CPU usage shouldn't be happening. Please investigate this issue as it severely impacts performance.
Steps to Reproduce:
Expected Behavior: CPU usage should remain at a reasonable level without causing performance issues.
Actual Behavior: CPU usage spikes to 95%, causing significant slowdowns.
Attachment:
Thank you for looking into this issue. Please let me know if you need any further information.