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

WIP: Improve crate compilation times #1076

Closed

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Oct 25, 2019

Hopefully this will make improvements towards #1017. As I'm going I'll try to post numbers so we can see how changes affect compilation times.

Initial breakdown of compilation times using cargo build -Ztimings:
timings.zip

@Michael-F-Bryan
Copy link
Contributor Author

After updating Cargo.lock with cargo update and manually upgrading env_logger from 0.6 to 0.7, compilation time dropped from 97.7s to 85.9s.

I'm guessing the compilation improvements are because we aren't compiling multiple versions of the same crate.

bump-dependency-versions.zip

@ehuss
Copy link
Contributor

ehuss commented Oct 25, 2019

Thanks! Looks like it bumps msrv to 1.37 (I think)? Would be fine with me.

@Michael-F-Bryan
Copy link
Contributor Author

Michael-F-Bryan commented Oct 25, 2019

For some reason, removing the itertools crate (it was only used two or three times to skip an allocation when concatenating lines) and running cargo clean && cargo build -Ztimings again dropped compilation times on my machine to 60s.

remove-itertools.zip

I don't think itertools was to blame... maybe it had something to do with build order or a warm page cache?

New dependency graph:

dependency-graph

@Dylan-DPC-zz
Copy link

@ehuss yeh most likely this will be a breaking change so might as well release a new major version when finished which would also justify the msvr bump

@Michael-F-Bryan
Copy link
Contributor Author

Michael-F-Bryan commented Oct 25, 2019

I just removed toml-query and the "build" stage in CI went from 4 mins 11 secs to 3 mins 49 secs.

New dependency graph:

dependency-graph

Timings: remove-toml-query.zip

@Michael-F-Bryan
Copy link
Contributor Author

I swapped out iron with simple-server and the "build" stage in CI went from 4 mins 1 second to 3 mins 52 seconds.

dependency-graph

Timings:
remove-iron.zip

@ehuss
Copy link
Contributor

ehuss commented Mar 9, 2020

@Michael-F-Bryan Is this ready to go? You still have WIP in the title. I really like the changes, and it looks good to go to me.

@ehuss ehuss added this to the 0.4 milestone Mar 9, 2020
@Michael-F-Bryan
Copy link
Contributor Author

I'm not certain it makes much of a difference. When running on my laptop I found the results super noisy and inconsistent, and I wasn't confident the compile time improvements weren't just due to something like the page cache or CPU governor changing clock frequency...

@ehuss ehuss mentioned this pull request May 5, 2020
@ehuss
Copy link
Contributor

ehuss commented May 20, 2020

Thanks for getting this going! Closed via #1211.

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.

3 participants