substrate-docs
substrate-docs copied to clipboard
[Content] Tips & tricks for better developement experience, Testing & building
Content request
Build times: I have a development question. With substrate I find myself making small changes and wanting to test them out. I run cargo build --release and it takes like 4 minutes which seems a little bit long to me. Is there a way to speed this up? Scipio_Publius changed their display name to Cato andreas During development, you can skip the --release flag. No need for an optimized build while still changing things frequently. Dan | Parity Tech get a more powerful machine 😬 there are tweaks, but there is nothing to radically change the build times. Using rust-analyzer can help identify simple issues without a full build, but it's not perfect and doesn't actually build a binary on it's own AFAIK.
If trying basic things in a temporary environment is what you are after, you can try out https://docs.substrate.io/playground/ Note that sessions here are time limited, it's not a replacement for building on your own hardware long term. clarklee cargo build --release -p pallet-xxx h4x | Phala Network Suggest to get a cpu with more cores. The more the better. Btw if you just want to check the code, cargo test or even cargo check will be much faster Holland ok thank you! I'm using windows subsystem for linux. Does that limit the build speeds at all? Dan | Parity Tech Likely yes https://techunwrapped.com/who-works-better-ubuntu-vs-windows-subsystem-for-linux/ As we can see in most of the tests, in most of them Ubuntu offers a better performance than WSL, although not by much difference. In tests that do a moderate CPU usage, WSL2 performs quite well and does not lose much distance with its rival. However, when CPU intensive use is made, or I / O systems come into play, the difference grows to almost 50% in Ubuntu’s favor. substrate builds for me max out all threads for most of the build Holland ok, I guess I'll try going with Ubuntu. It should definitely improve the build times.
Are you willing to help with this request?
Yes!