Skip to content

Stop caching outputs with LazyInit in CompilerStack#15459

Closed
cameel wants to merge 1 commit intocompiler-stack-do-not-store-serialized-jsonfrom
compiler-stack-no-lazy-init-outputs
Closed

Stop caching outputs with LazyInit in CompilerStack#15459
cameel wants to merge 1 commit intocompiler-stack-do-not-store-serialized-jsonfrom
compiler-stack-no-lazy-init-outputs

Conversation

@cameel
Copy link
Collaborator

@cameel cameel commented Sep 26, 2024

Depends on #15451.

This is a follow-up to #15451, removing more of the data cached in CompilerStack: metadata, abi, storageLayout, transientStorageLayout, userDocumentation, devDocumentation, generatedSources and runtimeGeneratedSources are now always generated on demand.

This is a test PR to benchmark it see if it's even worth it.

If it's going to be merged, we should perhaps check if some of these aren't used a lot internally and better off cached after all.

@cameel cameel added performance 🐎 has dependencies The PR depends on other PRs that must be merged first labels Sep 26, 2024
@cameel cameel self-assigned this Sep 26, 2024
@cameel
Copy link
Collaborator Author

cameel commented Sep 26, 2024

Benchmarks

Results from external.sh, averaged over 3 runs. #15451 vs this PR.

File Pipeline Time (before) Time (after) Memory (before) Memory (after)
openzeppelin legacy 10 s 9 s 517 MiB 448 MiB
openzeppelin ir 33 s 32 s 497 MiB 508 MiB
uniswap-v4 legacy 21 s 20 s 1012 MiB 964 MiB
uniswap-v4 ir 119 s 119 s 1494 MiB 1493 MiB
eigenlayer legacy 74 s 73 s 2835 MiB 2444 MiB
eigenlayer ir 522 s 522 s 4457 MiB 4476 MiB

Looks like timing is the same. Memory use did fall a little on legacy, but on IR is practically unaffected.

The only field that's legacy-only are generated sources, so it seems that it's just those that are worth getting rid of.

@cameel
Copy link
Collaborator Author

cameel commented Sep 26, 2024

Closing in favor of #15460. Looks like all the gains here are indeed due to generated sources.

@cameel cameel closed this Sep 26, 2024
@cameel cameel deleted the compiler-stack-no-lazy-init-outputs branch September 26, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has dependencies The PR depends on other PRs that must be merged first performance 🐎

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant