AstarNetwork / astar-frame

Core frame modules for Astar & Shiden network.
Other
57 stars 38 forks source link

update custom pallets' weights #123

Closed shunsukew closed 1 year ago

shunsukew commented 1 year ago

Pull Request Summary Optimize custom pallets' weights by using benchmark machine as is already done for DappsStaking pallets https://github.com/AstarNetwork/astar-frame/pull/122

Target pallets

Machine spec used

Hardware
CPU
Intel Xeon-E 2136 - 6c/12t - 3.3 GHz/4.5 GHz
RAM
32 GB ECC 2666 MHz

Data disks
2×500 GB SSD NVMe

Expansion cards
Soft RAID

machine bench result

2022-12-19 07:35:38 Running machine benchmarks...    
2022-12-19 07:36:04 
+----------+----------------+--------------+--------------+-------------------+
| Category | Function       | Score        | Minimum      | Result            |
+=============================================================================+
| CPU      | BLAKE2-256     | 1.01 GiB/s   | 1.00 GiB/s   | ✅ Pass (100.1 %) |
|----------+----------------+--------------+--------------+-------------------|
| CPU      | SR25519-Verify | 658.82 KiB/s | 666.00 KiB/s | ✅ Pass ( 98.9 %) |
|----------+----------------+--------------+--------------+-------------------|
| Memory   | Copy           | 14.51 GiB/s  | 14.32 GiB/s  | ✅ Pass (101.3 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Seq Write      | 1.36 GiB/s   | 450.00 MiB/s | ✅ Pass (310.4 %) |
|----------+----------------+--------------+--------------+-------------------|
| Disk     | Rnd Write      | 497.77 MiB/s | 200.00 MiB/s | ✅ Pass (248.9 %) |
+----------+----------------+--------------+--------------+-------------------+
From 5 benchmarks in total, 5 passed and 0 failed (10% fault tolerance).    
2022-12-19 07:36:04 The hardware meets the requirements
shunsukew commented 1 year ago

Noticed that collator_selection pallet weights has obvious difference especially new_session. @akru Do you have any idea? (MaxCandidates for benchmarking are changed to from 999 to 148)

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/rmrk/src 0% 0%
frame/block-reward/src 82% 0%
frame/pallet-xvm/src/pallet 33% 0%
frame/pallet-xvm/src 11% 0%
precompiles/dapps-staking/src 93% 0%
precompiles/utils/macro/src 0% 0%
precompiles/utils/src 72% 0%
frame/custom-signatures/src 54% 0%
frame/xc-asset-config/src 67% 0%
chain-extensions/types/xvm/src 0% 0%
chain-extensions/dapps-staking/src 0% 0%
precompiles/utils/macro/tests 0% 0%
precompiles/substrate-ecdsa/src 78% 0%
precompiles/xvm/src 94% 0%
chain-extensions/types/rmrk/src 0% 0%
frame/dapps-staking/src/pallet 87% 0%
frame/pallet-xcm/src 64% 0%
precompiles/assets-erc20/src 73% 0%
precompiles/utils/src/data 72% 0%
frame/dapps-staking/src 89% 0%
precompiles/sr25519/src 79% 0%
precompiles/xcm/src 84% 0%
chain-extensions/types/dapps-staking/src 0% 0%
frame/collator-selection/src 80% 0%
primitives/xcm/src 66% 0%
chain-extensions/xvm/src 0% 0%
Summary 60% (2583 / 4311) 0% (0 / 0)

Minimum allowed line rate is 50%

akru commented 1 year ago

I guess this value comes from some default setting.

shunsukew commented 1 year ago

I see, thank you