-
Notifications
You must be signed in to change notification settings - Fork 232
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
Support parallel compilation of all input files #1382
Comments
I think there are few things that are needed.
|
I think this issue is a bit more difficult than it looks like. If one file depends on the other, they cannot be built in parallel, due to dependency resolution in sema. At least, the parser and the lever can run in parallel. |
I don't understand what you mean. What do you see as a problem? |
@seanyoung Consider this case: file A.sol:
file B.sol:
file C.sol
I can invoke Solang using For file C.sol, the contract needs to have contract A resolved. In addition, the Solana account collection in codegen expects the CFG from all contracts to be ready in order to collect accounts for function The way I see, we either can enable parallel compilation and let the compiler do repeated work for these cases (e.g. resolve A.sol solely for B.sol in one thread to generate B's binary, while A.sol is building in another thread to generate A's binary), or we need to construct a dependency tree to identify what can be parallelized and use many synchronization mechanisms throughout the code to make this work. |
This is not how Solang works and it could never work that way. Each file on the command line is new You are suggesting that when There are global things like user defined types which could have different definitions in different files. When you then import another file, that imported file needs to use the correct global definitions. So, sema and the following stages can run in parallel. Since we're using an lalr grammar, the parser stage should be pretty fast so I suspect this will make little difference. |
I apologize. I wasn't aware that Solang worked that way. By building both |
Input files can be compiled in parallel.
solang compile
parallel solang compile
in our CI jobs are no longer neededThe text was updated successfully, but these errors were encountered: