-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Contract compilation unusually slow on macOS #14337
Comments
perhaps related foundry-rs/foundry#5102 in foundry seeing indefinite build times on apple silicon |
Interesting. So you're seeing this slowdown outside of CircleCI and also on ARM macs? That's not great, because we still had some hope that maybe it's just bad performance of CircleCI's x86 machines and will resolve itself if we switch mac builds to ARM. |
@cameel i'm not sure if its the same thing, but there's definitely some issue on M1 machines that manifests on some repos and not others |
ok, we'll have to investigate and find out. Thanks for the info! |
disabling the model checker made my compilation start running ok, but the other repo linked in the issue on foundry doesn't seem to have the model checker |
The slowdown we're seeing in CI is definitely not related to SMTChecker, since the contracts we compile are not enabling it. So this must be different from your case. |
@cameel kk, fyi someone else on the linked issue didn't have the checker enabled and they saw a timeout after 15 mins |
After looking at this again today, looks like the difference is much smaller than I claimed in the description. There are 2 tests that are 2x/3x slower, but the rest much closer in reality, because the running time I posted includes dependency installation time, which is significant on macOS (several minutes, see #12925). Here's
The first two columns are just the So looks like in most cases macOS is just a bit slower. It has a 4 CPU machine, while Linux has 1 CPU, but most of these are not multi-threaded. The only exception is the fuzzer, which is reflected in the numbers. The biggest outliers are "remaining tests" and I think that, when reporting this, I saw the 2x difference in the main batch of tests and must have mistakenly looked at the others taking the whole running time or each job rather than just the time it takes to run the test. Sorry for the confusion. |
I'm preparing a PR that will parallelize CLI tests (#14339) and in particular the via-ir equivalence will now get its own run. Comparing that between Ubuntu and macOS, I see that it runs 14x slower on the latter:
~via_ir_equivalence
int_ubu_cli
: 30 sec~via_ir_equivalence
int_osx_cli
: 7 minThat's even bigger slowdown than we usually see when building solc, which is "only" 3x.
It also stands out compared to soltest, where macOS is about 2x slower:
t_ubu_clang_soltest
: ~8 min (20 parallel runs, ~25 sec each)t_osx_soltest
: ~16 minFor via IR eqvivalence most of the execution time is taken by solc compiling contracts rather than evmone executing them or unrelated things like running clang. It's possible that it's not CI that's the culprit here but rather that solc is unusually slow on macOS.
The excessive slowdown does not seem to be caused exclusively by IR compilation. The legacy compilation tests are affected to a similar degree:
~compilation_tests
int_ubu_cli
: 30 sec~compilation_tests
int_osx_cli
: 5 minReproducing the problem
Here's how to run these particular tests locally:
The text was updated successfully, but these errors were encountered: