Skip to content

Commit c31b995

Browse files
parachain-template: add release and production profiles explicitly (#8378)
Addressing paritytech/polkadot-sdk-parachain-template#35 Adding the production build profile for 15-30% speedup when people build with --profile production, see polkadot-developers/polkadot-docs#534 and polkadot-developers/polkadot-docs#575. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit ce69f0d)
1 parent 02c9e61 commit c31b995

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

templates/parachain/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ docify = { workspace = true }
1414

1515
[features]
1616
generate-readme = []
17+
18+
[profile.release]
19+
opt-level = 3
20+
panic = "unwind"
21+
22+
[profile.production]
23+
codegen-units = 1
24+
inherits = "release"
25+
lto = true

templates/parachain/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ WORKDIR /polkadot
44
COPY . /polkadot
55

66
RUN cargo fetch
7-
RUN cargo build --workspace --locked --release
7+
RUN cargo build --workspace --locked --profile production
88

99
FROM docker.io/parity/base-bin:latest
1010

11-
COPY --from=builder /polkadot/target/release/parachain-template-node /usr/local/bin
11+
COPY --from=builder /polkadot/target/production/parachain-template-node /usr/local/bin
1212

1313
USER root
1414
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \

templates/parachain/README.docify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Please see the installation section at [`crates.io/omni-node`](https://crates.io
9292
#### Build `parachain-template-runtime`
9393

9494
```sh
95-
cargo build --release
95+
cargo build --profile production
9696
```
9797

9898
#### Install `staging-chain-spec-builder`

templates/parachain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Please see the installation section at [`crates.io/omni-node`](https://crates.io
9494
#### Build `parachain-template-runtime`
9595

9696
```sh
97-
cargo build --release
97+
cargo build --profile production
9898
```
9999

100100
#### Install `staging-chain-spec-builder`

0 commit comments

Comments
 (0)