hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.27k stars 215 forks source link

Add a feature flag for the language server #1595

Closed xermicus closed 1 year ago

xermicus commented 1 year ago

The language server alone pulls over 200 dependencies, or close to half of our total dependencies. Currently, cargo build causes to compile 552 crates. With this feature flag, a cargo build --no-default-features --features llvm,wasm_opt compiles only 296 crates.

And there are some chunky ones in the language server too. With the LS I get the following timings:

Rank Unit Total Codegen Features
1. wasm-opt-sys v0.112.0 build script (run) 50.1s    
2. ethers-solc v2.0.10 16.0s 7.1s (45%) async, futures-util, sha2, svm, svm-builds, svm-solc
3. solang v0.3.3 bin "solang" 15.8s   contract-build, default, ethers-core, forge-fmt, inkwell, language_server, libc, llvm, rust-lapper, tokio, tower-lsp, wasm-opt, wasm_opt
4. solang-parser v0.3.3 build script (run) 13.8s   default
5. solang-parser v0.3.2 build script (run) 13.4s   default
6. lsp-types v0.94.1 9.9s 1.1s (11%) default
7. ethers-core v2.0.10 8.1s 3.5s (43%)  
8. lalrpop v0.20.0 7.9s 3.1s (39%)  
9. tokio v1.34.0 7.1s 3.6s (51%) bytes, default, fs, io-std, io-util, libc, macros, mio, net, num_cpus, process, rt, rt-multi-thread, signal-hook-registry, socket2, sync, time, tokio-macros
10. solang v0.3.3 6.5s 2.4s (38%) contract-build, default, ethers-core, forge-fmt, inkwell, language_server, libc, llvm, rust-lapper, tokio, tower-lsp, wasm-opt, wasm_opt
11. syn v1.0.109 6.2s 2.6s (41%) clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
12. foundry-config v0.2.0 6.2s 4.1s (66%)

Main offender is still wasm-opt by far, but we already have a flag for this.

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (45f01b4) 87.65% compared to head (be15217) 87.65%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1595 +/- ## ======================================= Coverage 87.65% 87.65% ======================================= Files 133 133 Lines 64300 64300 ======================================= Hits 56363 56363 Misses 7937 7937 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.