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

Minimize deps #32

Merged
merged 3 commits into from
Apr 12, 2021
Merged

Minimize deps #32

merged 3 commits into from
Apr 12, 2021

Conversation

Urhengulas
Copy link
Member

@Urhengulas Urhengulas commented Apr 10, 2021

This PR disables the default features of the dependency object, which results in good gains in build time (debug: -2.622s; release: -3.676s) and binary size (debug: -4.6MB; release: -69.3kB) (see results below).

It also updates and upgrades the other dependencies.


# this pr
$ hyperfine -p 'cargo clean' 'cargo build' 'cargo build --release'
Benchmark #1: cargo build
  Time (mean ± σ):      6.959 s ±  0.216 s    [User: 38.446 s, System: 2.313 s]
  Range (min … max):    6.476 s …  7.200 s    10 runs
 
Benchmark #2: cargo build --release
  Time (mean ± σ):     12.412 s ±  0.209 s    [User: 102.318 s, System: 2.519 s]
  Range (min … max):   12.196 s … 12.907 s    10 runs
 
Summary
  'cargo build' ran
    1.78 ± 0.06 times faster than 'cargo build --release'

$ exa -lB target/debug/flip-link && exa -lB target/release/flip-link
.rwxr-xr-x@ 19,621,368 urhengulas 11 Apr 17:18 target/debug/flip-link
.rwxr-xr-x@ 4,460,304 urhengulas 11 Apr 17:18 target/release/flip-link

# main
$ hyperfine -p 'cargo clean' 'cargo build' 'cargo build --release'
Benchmark #1: cargo build
  Time (mean ± σ):      9.581 s ±  0.112 s    [User: 55.811 s, System: 3.263 s]
  Range (min … max):    9.355 s …  9.765 s    10 runs
 
Benchmark #2: cargo build --release
  Time (mean ± σ):     16.088 s ±  0.116 s    [User: 150.146 s, System: 3.622 s]
  Range (min … max):   15.909 s … 16.281 s    10 runs
 
Summary
  'cargo build' ran
    1.68 ± 0.02 times faster than 'cargo build --release'

$ exa -lB target/debug/flip-link && exa -lB target/release/flip-link
.rwxr-xr-x@ 24,227,272 urhengulas 11 Apr 17:18 target/debug/flip-link
.rwxr-xr-x@ 4,529,560 urhengulas 11 Apr 17:18 target/release/flip-link

@Urhengulas
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 12, 2021

Build succeeded:

@bors bors bot merged commit d0a3199 into main Apr 12, 2021
@bors bors bot deleted the minimize-deps branch April 12, 2021 09:18
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

Successfully merging this pull request may close these issues.

2 participants