Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat(solc): optimize output selection in cache mode #1029

Merged
merged 26 commits into from
Mar 15, 2022

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Mar 14, 2022

Motivation

Closes #1009

Solution

only select output for files that are actually dirty and select nothing for other files that are pulled in by dirty files.

Some preliminary testing on https://github.com/maple-labs/loan/releases/tag/v3.0.0-beta.0

cached and modified MapleLoan.t.sol:

with this PR:

../../../foundry/target/release/forge build                                                                                                         ! tags/v3.0.0-beta.0 
[⠢] Compiling...
[⠑] Compiling 30 files with 0.8.7
Compiler run successful (with warnings)
../../../foundry/target/release/forge build  6.64s user 0.32s system 99% cpu 6.990 total

note the 30 files are 1 dirty + 29 imported. There's currently no easy way to fix this as the total number of source files in the CompilerInput is reported

current master

forge build                                                                                                                                              ! tags/v3.0.0-beta.0 
[⠢] Compiling...
[⠒] Compiling 1 files with 0.8.7
Compiler run successful (with warnings)
forge build  10.13s user 0.40s system 96% cpu 10.924 total

Todo

  • additional tests
  • more caching docs

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far so good - excited about this, will be even better on larger repos

ethers-solc/src/cache.rs Outdated Show resolved Hide resolved
Comment on lines +92 to +93
/// `{ "*": { "*": [ "*" ], "": [
/// "abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"] } }`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit formatting here prob pretty print better

@gakonst gakonst merged commit ff29e96 into gakonst:master Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize cache enabled recompile
2 participants