Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extreme performance degrade on ~1000 lines contracts #95

Open
joaquinlpereyra opened this issue Apr 7, 2022 · 6 comments
Open

Extreme performance degrade on ~1000 lines contracts #95

joaquinlpereyra opened this issue Apr 7, 2022 · 6 comments
Labels
question Further information is requested

Comments

@joaquinlpereyra
Copy link

Hi! Great plugin. Experimenting a bit with it and noticing some very bad degrade of performance when interacting with non-trivial contracts (>1000 lines).

I'm not usually a VSCode user so I'm not sure what information would be useful in this case. I'm using:

System information:

Version: 1.66.0
Commit: e18005f0f1b33c29e81d732535d8c0e47cafb0b5
Date: 2022-03-30T05:50:41.156Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Linux x64 5.13.0-39-generic

All extensions settings (and the related extensions settings as well) set to their default value.

I'd be glad to attach any extra debugging information which may help.

@vast-z
Copy link

vast-z commented Apr 16, 2022

I ran into the same situation, with a latency of about 2s, but CPU utilization under 30%

Version: 1.66.2 (Universal)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z (5 days ago)
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin arm64 21.4.0

@zarifpour
Copy link

I am experiencing issues too:

  • M2 Macbook Air on Sonoma
  • Large non-trivial contract with a lot of inheritance

Steps to reproduce:

  • Clone a complex protocol that contains a contract with 2000+ lines
  • Hold down TAB to create spaces
  • Observe lag

@tintinweb
Copy link
Member

please check out https://github.com/Consensys/vscode-solidity-auditor/releases/tag/v0.2.0 and report. should be much better although not completely fixable right now as cancellation tokens don't seem to properly work with editor change events.

@tintinweb tintinweb added the question Further information is requested label Oct 13, 2023
@zarifpour
Copy link

please check out v0.2.0 (release) and report. should be much better although not completely fixable right now as cancellation tokens don't seem to properly work with editor change events.

A big thank you for this release! The performance has improved significantly, but it is still not perfect.

Try opening a large contract (maybe one that inherits some methods) and hold down tab to observe the lag.

@zarifpour
Copy link

CleanShot.2023-10-16.at.15.11.03.mp4

@zarifpour
Copy link

zarifpour commented Oct 17, 2023

I've observed some concerning performance issues even with contracts that are shorter in lines of code. Notably, when flattened, one such contract expands to about ~38,000 lines, almost 10 times bigger than the previous problematic contract (when flattened). This leads me to think there might be underlying processes accounting for this expanded view.

While I'm uncertain about the exact role of "cancellation tokens", I speculate that the lag could be associated with loading editor decorations and other background processes.

Could it be that the entire source undergoes recompilation or a similar time-intensive process, leading to the lag? A potential solution could be caching unchanged objects and triggering recompilation only when there are modifications in inheritance, imports, or parent structures. For instance, simple white space changes shouldn't require intensive background processing if no inheritance attributes or relevant objects are altered.

I hope these insights are useful, and I appreciate the efforts on improving the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants