-
Notifications
You must be signed in to change notification settings - Fork 44
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
Extension becomes unusably slow for bigger projects #462
Comments
Here is where it fails for me: Basically before the commit, everything seems to be fine, but as soon as I uncomment all that code, it starts getting very slow. From there - it depends on how long (sometimes almost instantly, sometimes after messing around a bit) - it eventually just freezes up entirely and I have to disable the extension. I can delete the extension, and remove the code to reproduce this locally. |
Hey @0xPhaze, thanks for the reproduction, but the solnum repo appears to be private. |
Sorry, just noticed and it's public now |
Brilliant, we will take a look. Reproduction repos make such a difference, thank you. |
I tested on the given repo and given commit. I couldn't reproduce the freezing scenario. I benchmarked validation, analysis and formatting and it's all between 300 and 400 ms on my computer (i7-12650H, 16gb ram), on the biggest file (M32x32.sol, ~3000 LOC). I tried making several edits to see if it built up but no luck. What I can suggest is, when you notice the extension is being slow, please enable verbose logging, and then share the logs through a pastebin. The setting is |
@antico5 taking a look at the foundry.toml there are file permission configurations: Could there be a file permission error that blocks within the format call (which is |
What seems to be happening is that forge fmt is not exiting. Then our server is frozen because we are using execSync for calling it. We can't process other requests while we are waiting for that process. Not even I don't know why forge fmt could not be exiting properly. Perhaps it has to do with how we invoke it and how we send the standard input? As a potential solution I could suggest switching to async exec for format calls. |
@antico5 agreed. Are there any blocking calls to forge in validation? @0xPhaze can you try turning the |
@kanej no, only on the |
It's a bit hard for me to test, because this bug isn't easily reproducible. Though I remember that after it was stuck, changing the formatter setting to "none" or "prettier" didn't make a difference. I am still able to run |
Hey @0xPhaze, we released our changes to out forge support a few weeks ago. Are you still experiencing the same slow down issue, or can we close this issue? |
@kanej It seems to be working well so far. Thanks! Closing this issue. |
Thanks for the update @0xPhaze, what does the output show for those slowdowns? |
I've noticed a few times that when working in bigger projects, the plugin would just be too slow and not respond. I'm currently working on a personal project of mine, and just recently it suddenly got very slow. After writing a few more tests, the plugin stopped working completely, most notably, because I could not run the formatter anymore. I'm using
forge
as a formatter and can runforge fmt
in the console without a problem. Changing the formatter also did not help. I was able to use it again after deleting the extension and some lines of code, but it quickly broke down again. If I can trigger this consistently, I'll share the repo.My specs are:
Mac M2 Max 96GB
The text was updated successfully, but these errors were encountered: