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

Compile the Wasm node with -Oz #1729

Merged
merged 1 commit into from
Dec 8, 2021
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Dec 2, 2021

Uses new feature from Rust 1.57.0

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Dec 2, 2021
Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

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

Automatically approving tomaka's pull requests

@tomaka tomaka mentioned this pull request Dec 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2021

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      -94296 ┊ smoldot_light_base::json_rpc_service::Background<TPlat>::handle_request::{{closure}}::hf6dfe8bac221768b
      -81437 ┊ smoldot::executor::host::ReadyToRun::run_once::hf0dc7cfd64d93be8
      +38913 ┊ smoldot::executor::host::ReadyToRun::run_once::h964e71388f52d8eb
      -37553 ┊ wasmi_validation::func::FunctionValidationContext::step::h710b582a35726092
      -35197 ┊ smoldot::network::service::ChainNetwork<TNow>::next_event::{{closure}}::hd8e86d6fdf109a6b
      -34129 ┊ data_encoding::Encoding::decode_mut::h3615c2730457327f
      -30052 ┊ smoldot::json_rpc::methods::MethodCall::from_defs::h13c445cd467d5380
      -28772 ┊ wasmi::runner::Interpreter::do_run_function::h9714dee981be922d
      -26777 ┊ wasmi::prepare::compile::Compiler::compile_instruction::heb3eb98fe9888879
      +25913 ┊ smoldot::json_rpc::methods::MethodCall::from_defs::hea2fe63733f6ad21
      +25660 ┊ data[0]
      +23655 ┊ wasmi::runner::Interpreter::do_run_function::h3476976f021073e4
      +22562 ┊ data_encoding::Encoding::decode_mut::h4adf6c8719d88aee
      -22422 ┊ smoldot_light_base::transactions_service::background_task::{{closure}}::h048b8037a3b1f428
      -22382 ┊ core::ptr::drop_in_place<smoldot_light_base::json_rpc_service::Background<smoldot_light_wasm::platform::Platform>::handle_request::{{closure}}>::h7e58bced796973e9
      -22074 ┊ smoldot_light_base::sync_service::standalone::start_standalone_chain::{{closure}}::hf465611d780878f4
      -21857 ┊ libsecp256k1_core::scalar::Scalar::inv_in_place::h592049c7171069dc
      +21627 ┊ smoldot_light_base::json_rpc_service::Background<TPlat>::handle_request::{{closure}}::hdcd50752ad05973f
      -21080 ┊ smoldot_light_base::network_service::NetworkService<TPlat>::new::{{closure}}::{{closure}}::h411e2730e39d05d1
      +20107 ┊ wasmi::prepare::compile::Compiler::compile_instruction::h762af5ad7f04cb2a
     -470838 ┊ ... and 18815 more.
     +674617 ┊ Σ [18835 Total Rows]

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

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

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@tomaka tomaka changed the title Compile the Wasm node with -Os Compile the Wasm node with -Oz Dec 5, 2021
@tomaka
Copy link
Contributor Author

tomaka commented Dec 5, 2021

Despite the report showing +671kiB, this results in almost one megabyte less after passing the wasm through wasm-opt.

@tomaka
Copy link
Contributor Author

tomaka commented Dec 8, 2021

The cargo-deny Docker image is now up-to-date with Cargo 1.57

@tomaka tomaka merged commit a8f268f into paritytech:main Dec 8, 2021
@tomaka tomaka deleted the custom-profile branch December 8, 2021 11:19
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.

1 participant