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

Reduce closure size #2

Open
dtzSiFive opened this issue Aug 17, 2022 · 1 comment
Open

Reduce closure size #2

dtzSiFive opened this issue Aug 17, 2022 · 1 comment

Comments

@dtzSiFive
Copy link
Owner

Presently closure is 1.3G:

$ nix path-info -Sh circt
/nix/store/r2hwc36mxj5s0j35491v95fks8gq91ij-circt-1.12.0-git-dd2e912	  1.3G

Contributing factors, to look into:

  • Use of static libraries (needs multiplexing 😉)
  • Unneeded references to build-time deps (Assertions: error messages include full path)
  • LLVM/MLIR are built as appropriate (mostly) for Nixpkgs, reduce the build config (host support, features)

Splitting inputs would also help (circt output path is 323M)

  • Docs: 162M (50%)
  • Libs: 55M (~17%)
  • Some bins can be put into dev output. Largest is circt-lsp-server.
@dtzSiFive
Copy link
Owner Author

Some findings:

Building without assertions (LLVM, MLIR, CIRCT) reduces this 1.3G -> 725.4M (and drops refs to various outputs from MLIR/LLVM, only retaining the lib output for LLVM).

LLVM lib output is 408M, contributing significantly (408M).

Here's where the references are:

$ nix why-depends /nix/store/zkmk41g8pmzgc1j63yzgzx51jbhfzv38-circt-1.12.0-git-dd2e912 /nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib --all --precise
/nix/store/zkmk41g8pmzgc1j63yzgzx51jbhfzv38-circt-1.12.0-git-dd2e912
└───bin/circt-lsp-server: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    bin/circt-opt: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    bin/circt-reduce: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    bin/circt-translate: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    bin/esi-tester: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    bin/firtool: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    lib/libcirct-llhd-signals-runtime-wrappers.so.16git: …12.0-git-dd2e912/lib:/nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib/lib:/nix/s…
    → /nix/store/ysr5p0yd9jxl72w3kwi8yjik0d6j6jvn-llvm-git-ae87a3b-lib

These refs are due to use of libLLVM*.so, which is 137M of the -lib output's 408M.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant