Substrate-template-node to build pallet and my laptop have Core-i7 chip, but the time to build is range from 9-12 minutes. So, when I change code and have to wait to build and run.
So, my question is Is there anyway to build faster?
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.Sign up to join this community
Some answers recommend to build with
--release or with a production profile. But this misses the point of the original question. If you do this the build will actually take longer due to a number of additional optimizations that are applied!
You should consider the difference between using
cargo build and
This will essentially compile the packages without performing the final step of code generation, which is faster than running cargo build.
So if you e.g. just want to check for compiler errors
cargo check is already sufficient.
If you're really in need for faster binary builds then having a beefy remote machine on which you execute the build via
cargo-remote can be an option. There are also reports that using a local
sccache installation + setting the environment variable
RUSTC_WRAPPER="sccache" speeds this process up due to the additional caching done through