vscode-solidity icon indicating copy to clipboard operation
vscode-solidity copied to clipboard

Extension causes high cpu load

Open SterlingKinder opened this issue 3 years ago • 23 comments

  • Issue Type: Performance
  • Extension Name: solidity
  • Extension Version: 0.0.102
  • OS Version: Windows_NT x64 10.0.18363
  • VSCode version: 1.52.1

:warning: Make sure to attach this file from your home-directory: :warning:c:\Users\ALEXAN~1\AppData\Local\Temp\JuanBlanco.solidity-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

SterlingKinder avatar Jan 16 '21 07:01 SterlingKinder

@SterlingKinder any more details?

juanfranblanco avatar Jan 16 '21 08:01 juanfranblanco

Having the same problem, vs code is saying the extension took a long time to complete its previous task and is preventing other extensions to run in background whenever I am starting vs code, thereby increasing cpu load

nirban256 avatar Jun 23 '22 05:06 nirban256

What are your settings?

juanfranblanco avatar Jun 23 '22 05:06 juanfranblanco

I have all the default settings

nirban256 avatar Jun 23 '22 05:06 nirban256

What is your project structure, OS?

juanfranblanco avatar Jun 23 '22 05:06 juanfranblanco

I am using Windows 10, writing smart contracts with Hardhat for dapps and for frontend I am using ReactJs having the hardhat simple basic project structure

nirban256 avatar Jun 23 '22 05:06 nirban256

can you make an screenshot of your project structure? Your current version of vscode solidity? Is autocomplete working?

juanfranblanco avatar Jun 23 '22 05:06 juanfranblanco

My current version of vs code solidity is v0.0.139 and yes it is giving me suggestions for autocompleting my code most of the times but sometimes it is not showing those.

Screenshot (1)

nirban256 avatar Jun 23 '22 05:06 nirban256

Hmmmm if you right click or press F5 to compile is it ok?

juanfranblanco avatar Jun 23 '22 05:06 juanfranblanco

yeah it is showing Compilation completed successfully!

nirban256 avatar Jun 23 '22 06:06 nirban256

Thank you, for all of this, I was just checking if there was something that might have caused this to be an issue, but nothing. Maybe this is due to trying to download the latest version of solidity when starting? Do you have any connectivity issues?

juanfranblanco avatar Jun 23 '22 06:06 juanfranblanco

Also is this just happening on the start of vscode?

juanfranblanco avatar Jun 23 '22 06:06 juanfranblanco

No I am not having any connectivity issue, yes the error is showing only when I am starting my vs code

nirban256 avatar Jun 23 '22 06:06 nirban256

Is your solidity version set to latest? image

juanfranblanco avatar Jun 23 '22 06:06 juanfranblanco

yes it is set to latest

nirban256 avatar Jun 23 '22 06:06 nirban256

Ok, I am assuming this is due when trying to load and download the latest version on startup, this will happen when is starting as it will be initialised using the current settings.

If you right click in a solidity smart contract and select this: image

And change it to 0.8.15 let me know if it makes any difference.

image

juanfranblanco avatar Jun 23 '22 06:06 juanfranblanco

Ok

nirban256 avatar Jun 23 '22 08:06 nirban256

I made the changes and the error is still showing

nirban256 avatar Jun 23 '22 16:06 nirban256

Thanks @nirban256, what is the spec of your PC? as this is not a normal issue.

juanfranblanco avatar Jun 23 '22 16:06 juanfranblanco

Processor Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz 3.10 GHz Installed RAM 8.00 GB (7.70 GB usable) System type 64-bit operating system, x64-based processor

nirban256 avatar Jun 23 '22 16:06 nirban256

Yes, that should not be an issue, if you don't have other processes hugging the cpu. Very strange, as you don't need to download the latest solidity and you are mainly loading the extension normally.

juanfranblanco avatar Jun 23 '22 17:06 juanfranblanco

No I am not running any other processes, hope that future updates will resolve the problem.

nirban256 avatar Jun 23 '22 17:06 nirban256