3

Substrate builds are resource intensive! Even with the rust toolchain getting better over time, it commonly takes 20+ minutes on mid-tier retail hardware (at the time of writing) to get Cumulus based parachains to build for production use.

The Rust performance book has a few hints that might help to tweak you builds, but to keep things on an even playing field, please just use the default rust & cargo settings on your machine and post:

  • Machine details (OS & version, CPU specs, RAM & speed, SSD & speed)
  • rustc version for stable and nightly (rustup show && rustup +nightly show)
  • Version tag of the Parachain Template you build (ex: polkadot-v0.9.20)

Gather this info and close all processes possible to have all resources devoted to your build.

Finally build that template using:

# No cheating ;)
cargo clean

# Get all files first, not confusion on build times
cargo fetch

# Release optimized build, with detailed timing messages included
cargo b -r --timings 

Post your details and the resulting HTML (in target/cargo-timings/)file's header table info (best to do by viewing in a browser), and copy/paste the CPU load graph here to show off your rigs' build power!

2
  • We should use a rolling uniform commit to use, updated on copy-write notice each year for Substrate perhaps?
    – Nuke Mod
    May 23, 2022 at 14:29
  • For any kind of performance test like this, you need to specify a commit hash for the codebase you are compiling, and a specific rust version you are using.
    – Shawn Tabrizi Mod
    May 23, 2022 at 21:08

6 Answers 6

2

Machine Specs

OS: Archlinux (btw)
CPU: Intel i9-12900K
RAM: Corsair 2x32 GB
Storage: Corsair 1 TB
rustc stable version: 1.61.0 (fe5b13d68 2022-05-18)
rustc nightly version: 1.63.0-nightly (28b891916 2022-05-29)
Parachain template version tag: ffb52cf5ba20eb824a792c927092196edd424f4d

Timing Info

Cargo Build Timings
Targets:    parachain-template-runtime 0.1.0 (lib)
parachain-template-node 0.1.0 (bin "parachain-collator")
pallet-template 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1164
Total units:    1164
Max concurrency:    27 (jobs=24 ncpu=24)
Build start:    2022-05-30T10:45:34Z
Total time: 300.9s (5m 0.9s)
rustc:  rustc 1.61.0 (fe5b13d68 2022-05-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

cpu plot

2
  • CPU plot is in the html generated waaaaay down the page past the gantt chart with each crate time.
    – Nuke Mod
    May 30, 2022 at 20:56
  • Ah, I see. They don't render on Firefox.
    – q9f
    May 31, 2022 at 10:34
2

From another user, submitting for (Librem 14):

Machine Specs

OS: PureOS 10
CPU: Intel i7-10710U
RAM: Samsung DDR4 2x32 GB 2667 MHz
Storage: Samsung 980 PRO NVMe
rustc stable version: 1.61.0
rustc nightly version: 1.63.0-nightly
Parachain template version tag: polkadot-v0.9.20

Timing Info & CPU Plot

Cargo Build Timings
Targets:    parachain-template-node 0.1.0 (bin "parachain-collator")
parachain-template-runtime 0.1.0 (lib)
pallet-template 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1181
Total units:    1181
Max concurrency:    20 (jobs=12 ncpu=12)
Build start:    2022-05-21T00:46:51Z
Total time: 1379.6s (22m 59.6s)
rustc:  rustc 1.61.0 (fe5b13d68 2022-05-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

Librem 14 Parachain Build CPU Plot

1

Using a https://system76.com/laptops/gazelle (model gaze17-3060-b) in high performance mode.

Machine specs

OS: Pop!_OS
CPU: Intel i7-12700Hls
RAM: G.Skill 2x16 GB
Storage: WD Black SN850 1 TB NVME PCI Gen 4
rustc stable version: rustc 1.61.0 (fe5b13d68 2022-05-18)
rustc nightly version: rustc 1.64.0-nightly (2f3ddd9f5 2022-06-27)
Parachain template version tag: e0388cbb1777c1fada8e2b649360b449869ffc64

Timing Info

Cargo Build Timings
Targets:    pallet-template 0.1.0 (lib)
parachain-template-runtime 0.1.0 (lib)
parachain-template-node 0.1.0 (bin "parachain-collator")
Profile:    release
Fresh units:    0
Dirty units:    1169
Total units:    1169
Max concurrency:    25 (jobs=20 ncpu=20)
Build start:    2022-06-28T23:33:05Z
Total time: 718.8s (11m 58.8s)
rustc:  rustc 1.61.0 (fe5b13d68 2022-05-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

enter image description here

1

Using a https://system76.com/laptops/darter (model System76 Darter Pro) in high performance mode, fans pinned to max (fn+1).

Machine specs

OS: Pop!_OS
CPU: Intel i7-1260P
RAM: G.Skill 2x16 GB
Storage: WD Black SN850 1 TB NVME PCI Gen 4
rustc stable version: rustc 1.63.0 (4b91a6ea7 2022-08-08)
rustc nightly version: rustc 1.65.0-nightly (c07a8b4e0 2022-08-26)
Parachain template version tag: fd9771eed9c478d544397ab9a8ccdb0627c06af7

Timing Info

Cargo Build Timings
Targets:    pallet-template 0.1.0 (lib)
parachain-template-node 0.1.0 (bin "parachain-template-node")
parachain-template-runtime 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1172
Total units:    1172
Max concurrency:    22 (jobs=16 ncpu=16)
Build start:    2022-08-27T23:08:02Z
Total time: 1125.3s (18m 45.3s)
rustc:  rustc 1.63.0 (4b91a6ea7 2022-08-08)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

enter image description here


Second run, fan automated... strangely much better performance. 🤷


Targets:    parachain-template-node 0.1.0 (bin "parachain-template-node")
pallet-template 0.1.0 (lib)
parachain-template-runtime 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1172
Total units:    1172
Max concurrency:    21 (jobs=16 ncpu=16)
Build start:    2022-08-27T23:38:10Z
Total time: 852.9s (14m 12.9s)
rustc:  rustc 1.63.0 (4b91a6ea7 2022-08-08)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

enter image description here

0
0

Using a ThinkPad X1 Carbon Gen 9 (lenovo 20xwcto1ww)

Machine Specs

OS: Pop!_OS 22.04 LTS
CPU: 11th Gen Intel i7-1165G7
RAM: Samsung DDR4 2x16 GB 4267 MHz
Storage: SKHynix 256 GB PCI3 NVMe
rustc stable version: 1.61.0
rustc nightly version: 1.64.0-nightly
Parachain template version tag: polkadot-v0.9.24

Timing Info & CPU Plot

Cargo Build Timings
Targets:    parachain-template-node 0.1.0 (bin "parachain-collator")
parachain-template-runtime 0.1.0 (lib)
pallet-template 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1169
Total units:    1169
Max concurrency:    15 (jobs=8 ncpu=8)
Build start:    2022-06-29T15:08:44Z
Total time: 1401.5s (23m 21.5s)
rustc:  rustc 1.61.0 (fe5b13d68 2022-05-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

enter image description here

0

Using a custom desktop

Machine Specs

OS: Ubuntu MATE 22.04 LTS
CPU: AMD Ryzen 7 1800X Eight-Core Processor
RAM: CRUCIAL 2x8 GB 2800 MHz + G.Skill 2x8 GB 2800 MHz
Storage: WD Black 2018/PC SN720 NVMe SSD
rustc stable version: 1.61.0
rustc nightly version: 1.64.0-nightly
Parachain template version tag: polkadot-v0.9.24

Timing Info & CPU Plot

Cargo Build Timings
Targets:    pallet-template 0.1.0 (lib)
parachain-template-node 0.1.0 (bin "parachain-collator")
parachain-template-runtime 0.1.0 (lib)
Profile:    release
Fresh units:    0
Dirty units:    1169
Total units:    1169
Max concurrency:    22 (jobs=16 ncpu=16)
Build start:    2022-06-29T22:46:27Z
Total time: 854.9s (14m 14.9s)
rustc:  rustc 1.61.0 (fe5b13d68 2022-05-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency: 0

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .