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

Align WASM feature set in scrypto compiler #1973

Merged
merged 10 commits into from
Oct 25, 2024

Conversation

lrubasze
Copy link
Contributor

@lrubasze lrubasze commented Oct 23, 2024

Summary

Since LLVM 19 below features are enabled by default (see release notes)

  • reference-types
  • multivalue.

This PR makes sure that Scrypto compiler builds C dependencies with WASM MVP + mutable-global + sign-ext features (exactly as RadixEngine expects and exactly what Rust native libraries are built with) no matter what LLVM version is available on the system.

NOTE!
Important takeaway is the fact that C dependencies are build with system LLVM, while native Rust libraries are built with LLVM built-in into Rust compiler.

Test

Relevant tests added

@lrubasze lrubasze changed the title Tweak/scrypto compiler reference types Align WASM feature set in scrypto compiler Oct 23, 2024
Copy link

github-actions bot commented Oct 23, 2024

Docker tags
docker.io/radixdlt/private-scrypto-builder:60c1375cb9

Copy link

github-actions bot commented Oct 23, 2024

Benchmark for 60c1375

Click to view benchmark
Test Base PR %
costing::bench_prepare_wasm 44.5±0.10ms 44.1±0.21ms -0.90%
costing::decode_encoded_i8_array_to_manifest_raw_value 19.3±0.01ms 19.3±0.01ms 0.00%
costing::decode_encoded_i8_array_to_manifest_value 42.3±0.28ms 42.8±0.74ms +1.18%
costing::decode_encoded_tuple_array_to_manifest_raw_value 72.0±0.07ms 71.9±0.10ms -0.14%
costing::decode_encoded_tuple_array_to_manifest_value 98.7±0.49ms 98.8±0.44ms +0.10%
costing::decode_encoded_u8_array_to_manifest_raw_value 25.6±0.04µs 25.8±0.09µs +0.78%
costing::decode_encoded_u8_array_to_manifest_value 42.4±0.28ms 42.5±0.18ms +0.24%
costing::decode_rpd_to_manifest_raw_value 14.4±0.05µs 14.4±0.02µs 0.00%
costing::decode_rpd_to_manifest_value 11.0±0.03µs 10.9±0.08µs -0.91%
costing::deserialize_wasm 1229.8±8.82µs 1233.8±9.14µs +0.33%
costing::execute_transaction_creating_big_vec_substates 687.8±12.37ms 692.8±15.61ms +0.73%
costing::execute_transaction_reading_big_vec_substates 578.7±3.43ms 616.8±2.02ms +6.58%
costing::instantiate_flash_loan 1028.7±1065.03µs 894.2±532.53µs -13.07%
costing::instantiate_radiswap 1001.3±799.82µs 1023.3±1514.34µs +2.20%
costing::spin_loop 17.8±0.06ms 17.8±0.05ms 0.00%
costing::spin_loop_v2 2.7±0.01s 2.7±0.00s 0.00%
costing::spin_loop_v3 611.3±3.63ms 608.5±2.40ms -0.46%
costing::validate_sbor_payload 29.4±0.11µs 28.9±0.05µs -1.70%
costing::validate_sbor_payload_bytes 247.4±0.57ns 244.1±0.55ns -1.33%
costing::validate_secp256k1 76.7±0.25µs 76.7±0.12µs 0.00%
costing::validate_wasm 33.6±0.03ms 33.5±0.03ms -0.30%
decimal::add/0 8.4±0.00ns 8.4±0.00ns 0.00%
decimal::add/rust-native 9.9±0.02ns 9.9±0.01ns 0.00%
decimal::add/wasmi 215.9±0.54ns 217.5±0.48ns +0.74%
decimal::add/wasmi-call-native 2.1±0.00µs 2.1±0.01µs 0.00%
decimal::div/0 165.4±0.21ns 164.9±0.11ns -0.30%
decimal::from_string/0 161.8±0.31ns 162.2±0.44ns +0.25%
decimal::mul/0 127.0±0.09ns 126.4±0.03ns -0.47%
decimal::mul/rust-native 122.8±0.27ns 122.6±0.12ns -0.16%
decimal::mul/wasmi 11.1±0.05µs 11.2±0.07µs +0.90%
decimal::mul/wasmi-call-native 2.2±0.00µs 2.2±0.01µs 0.00%
decimal::pow/0 579.2±0.24ns 573.5±0.28ns -0.98%
decimal::pow/rust-native 574.1±0.75ns 580.5±0.25ns +1.11%
decimal::pow/wasmi 56.7±0.24µs 57.4±0.22µs +1.23%
decimal::pow/wasmi-call-native 3.2±0.01µs 3.1±0.01µs -3.13%
decimal::root/0 8.3±0.01µs 8.1±0.01µs -2.41%
decimal::sub/0 8.2±0.01ns 8.2±0.01ns 0.00%
decimal::to_string/0 444.3±0.74ns 439.4±1.15ns -1.10%
large_transaction_processing::prepare 2.4±0.00ms 2.5±0.00ms +4.17%
large_transaction_processing::prepare_and_decompile 6.2±0.03ms 6.2±0.03ms 0.00%
large_transaction_processing::prepare_and_decompile_and_recompile 27.4±2.72ms 28.1±2.42ms +2.55%
precise_decimal::add/0 8.8±0.02ns 9.1±0.01ns +3.41%
precise_decimal::add/rust-native 10.8±0.13ns 10.8±0.07ns 0.00%
precise_decimal::add/wasmi 271.6±0.96ns 276.4±0.58ns +1.77%
precise_decimal::add/wasmi-call-native 2.8±0.00µs 2.8±0.01µs 0.00%
precise_decimal::div/0 297.8±1.45ns 301.1±1.57ns +1.11%
precise_decimal::from_string/0 203.8±0.25ns 202.5±0.35ns -0.64%
precise_decimal::mul/0 351.7±1.78ns 330.3±1.29ns -6.08%
precise_decimal::mul/rust-native 272.8±0.21ns 275.7±0.22ns +1.06%
precise_decimal::mul/wasmi 33.5±0.52µs 33.6±0.45µs +0.30%
precise_decimal::mul/wasmi-call-native 3.1±0.00µs 3.1±0.00µs 0.00%
precise_decimal::pow/0 1668.1±2.24ns 1663.4±1.03ns -0.28%
precise_decimal::pow/rust-native 1320.6±5.88ns 1314.6±2.55ns -0.45%
precise_decimal::pow/wasmi 161.5±0.65µs 162.7±0.61µs +0.74%
precise_decimal::pow/wasmi-call-native 5.3±0.03µs 5.3±0.01µs 0.00%
precise_decimal::root/0 58.6±0.02µs 58.1±0.02µs -0.85%
precise_decimal::sub/0 9.0±0.08ns 9.2±0.03ns +2.22%
precise_decimal::to_string/0 700.4±1.59ns 697.0±0.88ns -0.49%
schema::validate_payload 394.8±1.05µs 385.3±0.65µs -2.41%
transaction::radiswap 4.8±0.04ms 4.8±0.04ms 0.00%
transaction::transfer 1815.6±3.63µs 1812.1±12.68µs -0.19%
transaction_validation::validate_manifest 43.1±0.03µs 43.2±0.06µs +0.23%
transaction_validation::verify_bls_2KB 1064.2±16.74µs 1064.2±13.73µs 0.00%
transaction_validation::verify_bls_32B 1009.3±14.69µs 1003.6±13.05µs -0.56%
transaction_validation::verify_ecdsa 74.6±0.14µs 74.6±0.06µs 0.00%
transaction_validation::verify_ed25519 42.3±0.07µs 46.1±0.10µs +8.98%

Copy link
Member

@iamyulong iamyulong left a comment

Choose a reason for hiding this comment

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

Looks really good!

scrypto-compiler/src/lib.rs Outdated Show resolved Hide resolved
@lrubasze lrubasze force-pushed the tweak/scrypto-compiler-reference-types branch from d3d97ee to f7b46f2 Compare October 25, 2024 07:49
@lrubasze lrubasze merged commit d13f0bb into develop Oct 25, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants