Description
Currently the runtime subassembly is always created if present, even if the evm.deployedBytecode
/--bin-runtime
output is not requested. It happens even when this output is not available, e.g. in command-line Yul mode. While this is not the slowest part of the pipeline, it's still a fair chunk of unnecessary processing that may add up in big projects and could be completely avoided.
Details
We have two separate places where this happens:
- In
CompilerStack::assembleYul()
for Solidity compilation (note that despite the name, this handles the non-IR assembling as well; we should rename the function). - In
YulStack::assembleWithDeployed()
for pure Yul compilation.
We should make the deployed LinkerObject
and optional result and only generate it when requested.
Note that code generation, optimization and Yul->EVM transformation is already being reused, because creation and deployed assemblies are a part of the same object tree. It's just the final assembling step that is performed independently.