-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Slow forge build compilation times #8689
Comments
We have a lot of inline assembly in our contracts, is it possible that there is non-memory-safe assembly causing some sort of compiler issue? Is there a good way to analyze this? |
i believe this config var is only relevant for fuzzing, (unfortunately) not compiling |
Unrelated to Foundry, |
My computer is m3 24gb system version Sonoma 14.6.1 The test script tests a token, inherits the Test contract of forge, and the configuration is enabled via_ir = true, compiler version 0.8.26 When I enable via_ir, it takes me at least a minute to compile a file. This problem seems to only occur in the inheritance of the forge test contract and the latest macos system. |
@vseae Do you mean that a some change in Forge Std has impacted the compilation time via-ir - what happens if you downgrade forge-std with
Solady uses custom files for Forge Std, can you try using them to see if there's difference? |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (f8aa4af 2024-08-17T00:18:27.502409000Z)
What command(s) is the bug in?
forge build --force
Operating System
macOS (Apple Silicon)
Describe the bug
My team is experiencing very long forge build times, hurting Dev UX. I have spent a good amount of time reading through previous issues related to slow compilation times, but cannot find anything that would be relevant today. Currently running Apple Silicon with Sonoma 14.5.
Project Bytesize
I am unable to reproduce the issue with https://github.com/Vectorized/solady. It takes only 15.47s to compile 152 files. https://github.com/latticexyz/mud takes only 1.46s to compile 91 files.
Previous issues I am referencing:
foundry-rs/forge-std#217
foundry-rs/forge-std#225
ethereum/solidity#15141
Things I have tried
forge clean
&forge build --force
via_ir
.threads
to numbers greater than 0. Only 1 thread appears to be used bysolc
process in htop regardless of setting.Foundry Configuration
Build Times
Solc 0.8.13
Solc 0.8.26
30s quicker than
solc 0.8.13
Solc 0.8.26
via_ir
enabledThis runs into the stack too deep issue.
Help here would be appreciated! People that have experienced, or investigated the issue previously:
@zerosnacks @mattsse @ZeroEkkusu @marktoda @mds1
The text was updated successfully, but these errors were encountered: