Skip to content
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

limit codegen-units to get the maximum optimization #2138

Merged
merged 5 commits into from
Mar 14, 2022

Conversation

sabify
Copy link
Contributor

@sabify sabify commented Mar 13, 2022

Hello,

There might be a performance regression due to enabling lto without limiting the number of code generation units (codegen-units = 1).

References:
rust-lang/rust#47745
https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Mar 13, 2022

User @sabify, please sign the CLA here.

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change makes sense to me. thanks for contributing 🙏

Cargo.toml Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
sabify and others added 2 commits March 14, 2022 00:36
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Copy link
Contributor

@tomaka tomaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 14, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
      -47269 ┊ smoldot::executor::host::ReadyToRun::run_once::hce8991fa14cad99e
      +46242 ┊ smoldot::executor::host::ReadyToRun::run_once::h3fcc59051bdddd8e
      +42490 ┊ smoldot::json_rpc::methods::MethodCall::from_defs::h1204f543f3cab38f
      -42088 ┊ smoldot::json_rpc::methods::MethodCall::from_defs::h20a5b657120e0df0
      -25760 ┊ data[0]
      +24474 ┊ wasmi::runner::Interpreter::do_run_function::h5ad46fd45798232c
      -23655 ┊ wasmi::runner::Interpreter::do_run_function::h1d9d13ee2562db62
      +20025 ┊ wasmi::prepare::compile::Compiler::compile_instruction::h2c96786de3df97d2
      -20025 ┊ wasmi::prepare::compile::Compiler::compile_instruction::hf489b10a79fd7577
      +14915 ┊ <rand_chacha::chacha::ChaCha12Core as rand_core::block::BlockRngCore>::generate::h183a138761f91427
      -14915 ┊ <rand_chacha::chacha::ChaCha12Core as rand_core::block::BlockRngCore>::generate::h423816d94fa53ff2
      -14915 ┊ <rand_chacha::chacha::ChaCha20Core as rand_core::block::BlockRngCore>::generate::hdab9118613c13bb1
      +14915 ┊ <rand_chacha::chacha::ChaCha20Core as rand_core::block::BlockRngCore>::generate::hddf30a8319a72f4b
      -13086 ┊ sha2::sha512::soft::sha512_digest_block_u64::hbfd626ae3429a7bd
      -13086 ┊ sha2::sha512::soft::sha512_digest_block_u64::hd3baa310419eb6b6
      +13086 ┊ sha2::sha512::soft::sha512_digest_block_u64::hd3eb89d9a3b80320
      +13086 ┊ sha2::sha512::soft::sha512_digest_block_u64::hee89380fd02988b5
      -13021 ┊ <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hf2b8c9e998246e96
      -12275 ┊ wasmi_validation::func::FunctionValidationContext::step::he84b45aea78a58d1
      +12183 ┊ wasmi_validation::func::FunctionValidationContext::step::h86de041166276d61
      -47578 ┊ ... and 31561 more.
     -313468 ┊ Σ [31581 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Mar 14, 2022
@mergify mergify bot merged commit c4d9437 into paritytech:main Mar 14, 2022
@sabify sabify deleted the patch-1 branch March 14, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants