vscode-bundle-size icon indicating copy to clipboard operation
vscode-bundle-size copied to clipboard

High CPU usage when using the extension MBP M1 PRO

Open lusqua opened this issue 6 months ago • 4 comments

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:

lusqua      94803   0.0  0.0 410592976   1136 s004  R+    4:51PM   0:00.00 grep esbuild
lusqua      94733   0.0  4.7 411819248 782048   ??  S     4:51PM   0:04.96 /Users/lusqua/.vscode/extensions/ambar.bundle-size-1.8.0/node_modules/@esbuild/darwin-arm64/bin/esbuild --service=0.21.3 --ping

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).

image

System Info:

  • MacBook Pro M1 (8 cores, 16GB RAM)
  • macOS version: [Your macOS version]
  • VSCode version: [Your VSCode version]
  • Extension version: 1.8.0

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:

  1. Enable the extension in VSCode.
  2. Run ESLint or work in a project where the extension is active.
  3. Monitor CPU usage.

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:

  • Screenshot of the CPU usage before and after disabling the extension.

Thank you for looking into this issue. Please let me know if you need any further information.

lusqua avatar Aug 13 '24 20:08 lusqua