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

Improve Rust Analyzer's performance on the main branch #1779

Merged
merged 40 commits into from
Apr 22, 2024

Conversation

0xOmarA
Copy link
Member

@0xOmarA 0xOmarA commented Apr 19, 2024

Summary

This PR improves Rust analyzer's performance on the main branch by getting rid of a cyclic path that we had in our crates where things like scrypto::scrypto::scrypto::scrypto::scrypto::prelude::* were valid paths.

@0xOmarA 0xOmarA marked this pull request as ready for review April 19, 2024 16:48
Copy link

github-actions bot commented Apr 19, 2024

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

@0xOmarA 0xOmarA changed the base branch from main to release/anemone April 19, 2024 17:05
Copy link

github-actions bot commented Apr 19, 2024

Benchmark for e25496e

Click to view benchmark
Test Base PR %
costing::bench_prepare_wasm 66.6±0.18ms 66.2±0.14ms -0.60%
costing::decode_sbor 11.1±0.03µs 10.9±0.05µs -1.80%
costing::decode_sbor_bytes 29.1±0.02µs 29.5±0.08µs +1.37%
costing::deserialize_wasm 1276.8±2.73µs 1283.1±2.69µs +0.49%
costing::instantiate_flash_loan 4.0±0.71ms 4.1±0.88ms +2.50%
costing::instantiate_radiswap 5.7±0.06ms 5.7±0.06ms 0.00%
costing::spin_loop 21.9±0.05ms 24.1±0.26ms +10.05%
costing::validate_sbor_payload 27.4±0.04µs 27.4±0.03µs 0.00%
costing::validate_sbor_payload_bytes 231.3±0.61ns 240.1±3.01ns +3.80%
costing::validate_secp256k1 79.5±0.05µs 79.5±0.05µs 0.00%
costing::validate_wasm 37.0±0.19ms 36.7±0.06ms -0.81%
decimal::add/0 8.4±0.00ns 8.4±0.05ns 0.00%
decimal::add/rust-native 9.8±0.01ns 9.8±0.02ns 0.00%
decimal::add/wasmer 117.7±0.15ns 117.7±0.13ns 0.00%
decimal::add/wasmer-call-native 431.1±0.56ns 423.7±0.48ns -1.72%
decimal::add/wasmi 559.2±3.81ns 662.7±2.19ns +18.51%
decimal::add/wasmi-call-native 4.4±0.01µs 4.7±0.04µs +6.82%
decimal::div/0 179.4±0.27ns 180.1±0.29ns +0.39%
decimal::from_string/0 158.4±0.33ns 157.2±0.22ns -0.76%
decimal::mul/0 140.8±0.31ns 141.0±0.39ns +0.14%
decimal::mul/rust-native 139.4±0.07ns 138.0±0.08ns -1.00%
decimal::mul/wasmer 1493.5±1.17ns 1486.6±1.12ns -0.46%
decimal::mul/wasmer-call-native 555.3±0.19ns 526.6±0.36ns -5.17%
decimal::mul/wasmi 40.3±0.17µs 40.9±0.07µs +1.49%
decimal::mul/wasmi-call-native 4.5±0.00µs 4.6±0.01µs +2.22%
decimal::pow/0 651.9±0.47ns 653.9±0.54ns +0.31%
decimal::pow/rust-native 633.0±0.59ns 630.2±0.30ns -0.44%
decimal::pow/wasmer 6.7±0.00µs 6.5±0.01µs -2.99%
decimal::pow/wasmer-call-native 1006.1±1.26ns 993.3±1.69ns -1.27%
decimal::pow/wasmi 191.7±0.74µs 193.7±0.61µs +1.04%
decimal::pow/wasmi-call-native 4.4±0.01µs 4.5±0.01µs +2.27%
decimal::root/0 8.6±0.03µs 8.4±0.01µs -2.33%
decimal::sub/0 8.5±0.01ns 8.5±0.01ns 0.00%
decimal::to_string/0 445.0±0.41ns 444.5±0.23ns -0.11%
precise_decimal::add/0 9.5±0.08ns 9.6±0.03ns +1.05%
precise_decimal::add/rust-native 11.6±0.00ns 11.6±0.00ns 0.00%
precise_decimal::add/wasmer 115.1±0.16ns 115.2±0.11ns +0.09%
precise_decimal::add/wasmer-call-native 438.3±0.23ns 437.2±0.24ns -0.25%
precise_decimal::add/wasmi 706.5±4.40ns 793.9±2.08ns +12.37%
precise_decimal::add/wasmi-call-native 4.7±0.01µs 4.8±0.01µs +2.13%
precise_decimal::div/0 293.7±0.23ns 293.6±0.22ns -0.03%
precise_decimal::from_string/0 203.0±0.16ns 203.0±0.13ns 0.00%
precise_decimal::mul/0 313.1±0.58ns 313.2±0.73ns +0.03%
precise_decimal::mul/rust-native 291.5±0.39ns 296.2±2.69ns +1.61%
precise_decimal::mul/wasmer 3.6±0.00µs 3.5±0.02µs -2.78%
precise_decimal::mul/wasmer-call-native 809.2±2.22ns 757.7±1.45ns -6.36%
precise_decimal::mul/wasmi 103.4±0.22µs 105.3±0.11µs +1.84%
precise_decimal::mul/wasmi-call-native 5.2±0.01µs 5.3±0.02µs +1.92%
precise_decimal::pow/0 1743.4±1.54ns 1756.4±4.01ns +0.75%
precise_decimal::pow/rust-native 1408.2±3.87ns 1436.8±2.31ns +2.03%
precise_decimal::pow/wasmer 16.3±0.01µs 16.3±0.01µs 0.00%
precise_decimal::pow/wasmer-call-native 1992.5±3.61ns 1985.5±1.93ns -0.35%
precise_decimal::pow/wasmi 500.8±0.93µs 510.2±0.86µs +1.88%
precise_decimal::pow/wasmi-call-native 10.7±0.12µs 10.5±0.06µs -1.87%
precise_decimal::root/0 61.7±0.19µs 62.3±0.09µs +0.97%
precise_decimal::sub/0 9.5±0.01ns 9.5±0.00ns 0.00%
precise_decimal::to_string/0 703.0±0.91ns 701.0±0.99ns -0.28%
schema::validate_payload 392.4±0.42µs 373.4±0.79µs -4.84%
transaction::radiswap 5.6±0.02ms 5.5±0.02ms -1.79%
transaction::transfer 1778.9±2.76µs 1850.1±6.78µs +4.00%
transaction_processing::prepare 2.2±0.00ms 2.2±0.00ms 0.00%
transaction_processing::prepare_and_decompile 6.0±0.01ms 6.0±0.01ms 0.00%
transaction_processing::prepare_and_decompile_and_recompile 22.4±0.03ms 22.6±0.05ms +0.89%
transaction_validation::validate_manifest 43.9±0.05µs 43.8±0.06µs -0.23%
transaction_validation::verify_bls_2KB 1001.1±4.98µs 1004.6±10.12µs +0.35%
transaction_validation::verify_bls_32B 1048.2±26.71µs 1061.3±11.49µs +1.25%
transaction_validation::verify_ecdsa 77.3±0.09µs 77.2±0.04µs -0.13%
transaction_validation::verify_ed25519 54.9±0.07µs 55.2±0.04µs +0.55%

@0xOmarA 0xOmarA merged commit d5ce4d1 into release/anemone Apr 22, 2024
28 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.

None yet

6 participants