Skip to content

[template tutorial] Explain build profiles #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ggwpez opened this issue Apr 4, 2025 · 2 comments · Fixed by #557 · May be fixed by #575
Open

[template tutorial] Explain build profiles #534

ggwpez opened this issue Apr 4, 2025 · 2 comments · Fixed by #557 · May be fixed by #575

Comments

@ggwpez
Copy link
Contributor

ggwpez commented Apr 4, 2025

The tutorial mentions that the release profile builds production ready runtimes.
This is not true since it should rather use production profile to enable additional optimizations. We had a lot of parachains leaving 15-30% performance on the table by not knowing this.

The profile probably does not exist yet, but we can copy it from the SDK.

@nhussein11
Copy link
Collaborator

The profile probably does not exist yet, but we can copy it from the SDK.

@ggwpez What do you mean here?

@nhussein11 nhussein11 linked a pull request Apr 22, 2025 that will close this issue
@ggwpez
Copy link
Contributor Author

ggwpez commented Apr 22, 2025

The release profile in Rust does not have LTO and codegen optimizations enabled, that is why we add a production profile into the Polkadot SDK:

[profile.production]
codegen-units = 1
inherits = "release"
lto = true

Not using that ^ in production makes the runtime slower. It needs to be put into the Cargo.toml (of the workspace, if any) and can then be used with --profile production.

github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Apr 30, 2025
…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>
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Apr 30, 2025
…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>
paritytech-release-backport-bot bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Apr 30, 2025
…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)
castillax pushed a commit to paritytech/polkadot-sdk that referenced this issue May 12, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants