Comments (8)
I have submitted #532, #533, #534, #535 and #536 to start addressing this. Each are small version changes which allow cargo to unify more of the dependencies, and reduce the output of cargo tree -d
. Each change will only make a small effect, but changing crate versions is easy pickings.
from feather.
Hey!
I was reading this issue and I wanted to let you know about a tool I recently created that I think maybe some of you can find useful. This is obviously complementary to all these optimizations that you are making and that are clearly good in order to reduce compile times of feather.
I had recently stumbled upon some painfully long compile times in some of my personal/work projects written in rust (especially those with lots of dependencies) and I decided to investigate a little about it. I found out that in most cases the overhead was caused by the disk.
I created a small cargo command called
cargo-ramdisk
that sets up a ramdisk in the target folder. By using this tool I have been able to reduce compile times A LOT. For example in one of my biggest projects:Full Incremental
Without cargo-ramdisk 16m30s 4m30s
With cargo-ramdisk 1m30s 14.5s
The only "bad" thing about this tool is that every time you reboot your PC the incremental build will be lost. Also, this probably worked for me because I was compiling in WSL2 and there was some severe overhead. I have a M.2 SSD.It's far from perfect (and has some known bugs) but I leave you a link to the repo if someone wants to check it out.
Thanks for contributing to feather!
@PauMAVA
I just came across this and saw that cargo-ramdisk
gave you these huge speed improvements. I couldn't believe it and tried it myself on some project, and I didn't see any improvement, since, as expected, Rust compilation is not IO bound.
The speedup on your system is easily explainable by you compiling a project in WSL2 that was located in the windows filesystem, at which point compilation does become IO bound since WSL2<->Windows file system interop is incredibly slow. You should either keep the project in the WSL2 filesystem or compile from Windows.
from feather.
Maybe we should add cargo-deny to our CI? (it warns about duplicated dependencies and some other things)
from feather.
That sounds fantastic! I'll certainly give it a try because this sounds like it'd be useful for all sorts of rust work.
What did this slow down looked like in the cargo profiler output? It's pointing fingers at the semantic analysis of a lot of the crates for me, which doesn't sound right if the problem is the disk :D (I suspect my compilation could be being bottlenecked by the memory capacity on my laptop)
This may be of help.
https://endler.dev/2020/rust-compile-times/
from feather.
Sounds like a nice idea :)
from feather.
I'm having a look at good targets to reduce compile time in -Z timings
.
As always, syn
is by far the worst offender. Any proc macro crates we can remove are going to be a bonus.
wasmer
pulls in a lot of long-running builds. We should explore making it a feature that's normally off for development builds. Also maybe look at comparing it to wasmtime.serde_with
pulls indarling
, and it's probably easy to drop- making
serde_derive
configurable could help a lot with parallelism. With it,serde
crates are blocked for 4m on my computer! - the networking implementation can likely be written more simply without
tokio
but that'll take a decent amount of work. bitvec
andslab
aren't rlly necessary. they're being used as half-baked optimizations at the moment.itertools
is easy to remove. it's barely being used- trying to feature gate/remove
ureq
would be great too - it has a lot of unique dependencies.- maybe we can run in offline mode without ureq?
from feather.
Hey!
I was reading this issue and I wanted to let you know about a tool I recently created that I think maybe some of you can find useful. This is obviously complementary to all these optimizations that you are making and that are clearly good in order to reduce compile times of feather.
I had recently stumbled upon some painfully long compile times in some of my personal/work projects written in rust (especially those with lots of dependencies) and I decided to investigate a little about it. I found out that in most cases the overhead was caused by the disk.
I created a small cargo command called cargo-ramdisk
that sets up a ramdisk in the target folder. By using this tool I have been able to reduce compile times A LOT. For example in one of my biggest projects:
Full | Incremental | |
---|---|---|
Without cargo-ramdisk | 16m30s | 4m30s |
With cargo-ramdisk | 1m30s | 14.5s |
The only "bad" thing about this tool is that every time you reboot your PC the incremental build will be lost. Also, this probably worked for me because I was compiling in WSL2 and there was some severe overhead. I have a M.2 SSD.
It's far from perfect (and has some known bugs) but I leave you a link to the repo if someone wants to check it out.
Thanks for contributing to feather!
from feather.
That sounds fantastic! I'll certainly give it a try because this sounds like it'd be useful for all sorts of rust work.
What did this slow down looked like in the cargo profiler output? It's pointing fingers at the semantic analysis of a lot of the crates for me, which doesn't sound right if the problem is the disk :D (I suspect my compilation could be being bottlenecked by the memory capacity on my laptop)
from feather.
Related Issues (20)
- Change the representation of BlockPosition. HOT 4
- # Basic permission level HOT 1
- Improve github workflow HOT 2
- Make it easy to test plugins, and Implement test suite for them. HOT 1
- Modify block placement code in chunk.rs to update heightmaps.
- Permissions Registry & Support for Vanilla's OP System HOT 1
- Durability data missing, results in function that always returns None.
- Send entity equipment packet
- Server with IPv6 address on Linux HOT 2
- Roadmap HOT 1
- Make SessionServer an environment property.
- Request for changing the goals - to motivate contributors - to make the project thrive HOT 12
- Rewrite it in C HOT 4
- How to get to know the feather? HOT 5
- Question about code redundancy
- QUIC plugin system HOT 1
- Adding "Support" button for organization or author & contributors HOT 2
- issues using `cargo vendor` HOT 1
- error while compiling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feather.