Skip to content
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

meta(releases): reduce size of foundry binaries #8671

Open
karmacoma-eth opened this issue Aug 15, 2024 · 2 comments
Open

meta(releases): reduce size of foundry binaries #8671

karmacoma-eth opened this issue Aug 15, 2024 · 2 comments
Labels
A-releases Area: releases/packaging T-meta Type: meta

Comments

@karmacoma-eth
Copy link
Contributor

Component

Forge, Cast, Anvil, Chisel

Describe the feature you would like

on macOS, with last week's foundry, I noticed that the foundry binaries are quite large:

du -h ~/.foundry/bin
forge 0.2.0 (7f0f5b4 2024-08-08T00:20:13.526170000Z)
 22M	~/.foundry/bin/anvil
 44M	~/.foundry/bin/cast
 30M	~/.foundry/bin/chisel
 66M	~/.foundry/bin/forge

after foundryup, some of them got even bigger:

forge 0.2.0 (3e3b30c 2024-08-15T00:22:08.655383000Z)
 23M	~/.foundry/bin/anvil
 44M	~/.foundry/bin/cast
 31M	~/.foundry/bin/chisel
 67M	~/.foundry/bin/forge

This also contributes significantly to the size of docker images that install foundry. Thanks!

Additional context

No response

@karmacoma-eth karmacoma-eth added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Aug 15, 2024
@zerosnacks zerosnacks added A-releases Area: releases/packaging and removed T-needs-triage Type: this issue needs to be labelled labels Aug 15, 2024
@zerosnacks zerosnacks changed the title can we trim down the size of foundry binaries? feat(releases): reduce size of foundry binaries Aug 15, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Aug 16, 2024
@zerosnacks zerosnacks changed the title feat(releases): reduce size of foundry binaries meta(releases): reduce size of foundry binaries Sep 12, 2024
@zerosnacks zerosnacks added T-meta Type: meta and removed T-feature Type: feature labels Sep 12, 2024
@DaniPopes
Copy link
Member

A few more ideas:

  1. ethers removal feat: remove ethers #8826
  2. using dyn more in cheatcodes/db generic (this should be bigger) perf: use dyn Database to reduce churn and binary size #8404

@DaniPopes
Copy link
Member

DaniPopes commented Sep 22, 2024

Improvements since first post:

Before (forge 0.2.0 (3e3b30c 2024-08-15T00:19:22.864621297Z))

26M	./anvil
26M	./anvil.stripped
50M	./cast
50M	./cast.stripped
35M	./chisel
35M	./chisel.stripped
76M	./forge
76M	./forge.stripped

After (forge 0.2.0 (1d2379a 2024-09-22T00:23:17.631577994Z))

22M	./anvil
20M	./anvil.stripped
41M	./cast
36M	./cast.stripped
29M	./chisel
25M	./chisel.stripped
60M	./forge
54M	./forge.stripped
  • command: du -sh ~/.config/.foundry/bin/*
  • stripped with rm -f ./*.stripped; for f in ./*; do strip $f -o $f.stripped; done
  • on linux x64, which has larger binaries than OP's arm

Compare with February version (forge 0.2.0 (2cb8757 2024-02-03T00:16:46.961268899Z))

20M	./anvil
18M	./anvil.stripped
34M	./cast
31M	./cast.stripped
23M	./chisel
21M	./chisel.stripped
46M	./forge
42M	./forge.stripped

Note that the February version doesn't include much of alloy, has revm 3 which is pre-handlers, pre-eof, pre-soldeer etc; a ton less cheatcodes, config options... So some size increase is to be expected, but we can still do better

@grandizzy grandizzy removed this from the v1.0.0 milestone Nov 21, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-releases Area: releases/packaging T-meta Type: meta
Projects
Archived in project
Development

No branches or pull requests

4 participants