perf: don't request unnecessary output #231
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're currently requesting all
evm.bytecode
(andevm.deployedBytecode
) output by default. This includesevm.bytecode.generatedSources
, introduced in solc 0.8.0, which is a list of potentially huge Yul AST objects that is completely unused in Foundry.Only request the
Compact*
bytecode fields in the defaults.This cuts down a clean
forge build
:optimizer = false
)It may have a larger impact when compiling with >=0.8.28, because the cache storing this data was removed in that version (ethereum/solidity@3c5e46b), or when optimizations are disabled as more IR will be generated and output to JSON.
I verified that these inputs are accepted by solidity 0.4.14, 0.6.3, 0.8.28, and vyper 0.3.10, 0.4.0. All of these outputs are supported by all of them except for vyper which needs to be normalized.
Drive-by: buffer stdin when writing to the solc subprocess.