Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add benchmarking for parachain runtime paras pallet #3888

Merged
22 commits merged into from
Sep 22, 2021

Conversation

KiChjang
Copy link
Contributor

Part of #3850.

@KiChjang KiChjang added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Sep 17, 2021
@KiChjang KiChjang changed the title Add benchmarking for parachain paras pallet Add benchmarking for parachain runtime paras pallet Sep 17, 2021
@KiChjang KiChjang marked this pull request as ready for review September 18, 2021 02:11
@KiChjang
Copy link
Contributor Author

/benchmark runtime westend runtime_parachains::paras

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 18, 2021

Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    35.91
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     37.35     0.222    0.5%
 1044     38.22      0.17    0.4%
 1064     38.28     0.164    0.4%
 1084     38.38     0.173    0.4%
 1104     38.19      0.16    0.4%
 1124     38.47     0.354    0.9%
 1144     38.14     0.165    0.4%
 1164     38.31     0.183    0.4%
 1184     38.46     0.109    0.2%
 1204     38.56     0.205    0.5%
 1224     38.45     0.201    0.5%
 1244     38.42     0.157    0.4%
 1264      38.5     0.157    0.4%
 1284     38.87      0.25    0.6%
 1304     38.63     0.135    0.3%
 1324     38.95     0.203    0.5%
 1344     38.78     0.086    0.2%
 1364     38.68     0.262    0.6%
 1384     38.92     0.158    0.4%
 1404     38.83      0.15    0.3%
 1424     38.84     0.139    0.3%
 1444     39.17     0.148    0.3%
 1464     39.24     0.123    0.3%
 1484     38.93     0.227    0.5%
 1504     39.23     0.233    0.5%
 1524      39.1     0.172    0.4%
 1544     39.39     0.144    0.3%
 1564     39.43      0.35    0.8%
 1584     39.03     0.133    0.3%
 1604     39.46     0.223    0.5%
 1624     39.18     0.169    0.4%
 1644     39.41     0.199    0.5%
 1664      39.2     0.166    0.4%
 1684     39.34     0.146    0.3%
 1704     39.84     0.223    0.5%
 1724     39.63     0.223    0.5%
 1744     39.58     0.208    0.5%
 1764     39.54     0.159    0.4%
 1784     39.66      0.28    0.7%
 1804     39.73     0.148    0.3%
 1824     39.83     0.171    0.4%
 1844     39.89     0.261    0.6%
 1864     39.85      0.22    0.5%
 1884     40.07     0.175    0.4%
 1904     40.15     0.265    0.6%
 1924     40.02     0.232    0.5%
 1944     39.98     0.096    0.2%
 1964     39.98      0.13    0.3%
 1984     40.23     0.329    0.8%
 2004      40.1     0.124    0.3%
 2024     40.17     0.151    0.3%
 2044     40.11     0.135    0.3%

Quality and confidence:
param     error
c             0

Model:
Time ~=    35.85
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    15.57
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    15.57
              µs

Reads = 0
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    40.91
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     43.08     0.258    0.5%
 1044     43.03     0.188    0.4%
 1064     43.05     0.081    0.1%
 1084     43.27     0.251    0.5%
 1104     43.14      0.09    0.2%
 1124     43.39     0.258    0.5%
 1144     43.06     0.119    0.2%
 1164     43.57     0.385    0.8%
 1184     43.35     0.208    0.4%
 1204     43.45     0.176    0.4%
 1224     43.48     0.272    0.6%
 1244     43.51     0.233    0.5%
 1264     43.55     0.197    0.4%
 1284     43.71     0.183    0.4%
 1304     43.99      0.39    0.8%
 1324     43.89     0.267    0.6%
 1344     43.74     0.194    0.4%
 1364     43.93     0.259    0.5%
 1384     43.88      0.22    0.5%
 1404     43.93     0.169    0.3%
 1424     43.94     0.215    0.4%
 1444        44     0.173    0.3%
 1464      44.1     0.223    0.5%
 1484     44.05     0.203    0.4%
 1504     44.02     0.142    0.3%
 1524      44.1     0.309    0.7%
 1544     44.31     0.136    0.3%
 1564     44.35     0.192    0.4%
 1584     44.44     0.249    0.5%
 1604     44.37      0.16    0.3%
 1624     44.38     0.176    0.3%
 1644     44.37     0.136    0.3%
 1664     44.47     0.165    0.3%
 1684     44.46     0.333    0.7%
 1704     44.44     0.242    0.5%
 1724     44.65     0.275    0.6%
 1744     44.63     0.083    0.1%
 1764     44.76     0.348    0.7%
 1784     44.71     0.231    0.5%
 1804     44.86     0.172    0.3%
 1824     44.76     0.181    0.4%
 1844      44.8     0.138    0.3%
 1864     44.72     0.188    0.4%
 1884     44.66     0.078    0.1%
 1904     45.03     0.131    0.2%
 1924     45.11      0.16    0.3%
 1944     44.99      0.08    0.1%
 1964     44.92     0.193    0.4%
 1984     44.89      0.16    0.3%
 2004     45.23      0.21    0.4%
 2024     45.22     0.248    0.5%
 2044     45.02     0.117    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=    40.99
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:0)
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     21.4
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     21.4
              µs

Reads = 1
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.71
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.71
              µs

Reads = 2
Writes = 1


Parity Bot added 2 commits September 18, 2021 02:11
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
@KiChjang
Copy link
Contributor Author

/benchmark runtime kusama runtime_parachains::paras

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 18, 2021

Benchmark Runtime Kusama Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    36.65
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     38.19     0.161    0.4%
 1044     39.11     0.279    0.7%
 1064     39.13     0.092    0.2%
 1084     39.19     0.201    0.5%
 1104     39.21      0.16    0.4%
 1124     39.14     0.115    0.2%
 1144     39.12     0.112    0.2%
 1164     39.42     0.124    0.3%
 1184     39.26     0.189    0.4%
 1204     39.25     0.135    0.3%
 1224     39.29     0.098    0.2%
 1244      39.5     0.089    0.2%
 1264     39.47     0.143    0.3%
 1284     39.62     0.091    0.2%
 1304     39.69     0.119    0.2%
 1324     39.89      0.12    0.3%
 1344     39.62     0.183    0.4%
 1364     39.68     0.073    0.1%
 1384     39.64     0.081    0.2%
 1404     39.75     0.059    0.1%
 1424        40     0.115    0.2%
 1444        40      0.15    0.3%
 1464     39.89      0.07    0.1%
 1484     39.99     0.142    0.3%
 1504     40.15     0.209    0.5%
 1524     40.18      0.09    0.2%
 1544     40.45     0.125    0.3%
 1564     40.25      0.12    0.2%
 1584     40.36     0.137    0.3%
 1604     40.42     0.168    0.4%
 1624     40.33     0.225    0.5%
 1644     40.38     0.172    0.4%
 1664     40.24      0.15    0.3%
 1684     40.41      0.13    0.3%
 1704     40.66     0.086    0.2%
 1724      40.6     0.103    0.2%
 1744     40.65     0.173    0.4%
 1764     40.51     0.066    0.1%
 1784     40.71     0.135    0.3%
 1804     40.79      0.11    0.2%
 1824     40.76     0.133    0.3%
 1844      40.8     0.113    0.2%
 1864     40.76     0.166    0.4%
 1884     40.73      0.12    0.2%
 1904     40.85     0.127    0.3%
 1924     41.06     0.153    0.3%
 1944     41.11     0.055    0.1%
 1964     41.11     0.112    0.2%
 1984     41.12     0.221    0.5%
 2004        41     0.201    0.4%
 2024      41.2     0.134    0.3%
 2044     41.18      0.21    0.5%

Quality and confidence:
param     error
c             0

Model:
Time ~=    36.61
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.15
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    16.15
              µs

Reads = 0
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    42.23
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     44.27     0.194    0.4%
 1044     44.55     0.188    0.4%
 1064      44.7     0.222    0.4%
 1084     44.44     0.202    0.4%
 1104     44.57     0.221    0.4%
 1124     44.62     0.148    0.3%
 1144     44.64     0.132    0.2%
 1164     44.62     0.155    0.3%
 1184     44.76     0.241    0.5%
 1204     44.66     0.174    0.3%
 1224     45.24     0.289    0.6%
 1244     44.86     0.242    0.5%
 1264     44.93     0.184    0.4%
 1284     45.15     0.196    0.4%
 1304     45.21     0.196    0.4%
 1324     44.98     0.197    0.4%
 1344     45.25     0.226    0.4%
 1364     45.39     0.191    0.4%
 1384     45.41     0.189    0.4%
 1404     45.41     0.089    0.1%
 1424     45.59     0.219    0.4%
 1444     45.59     0.216    0.4%
 1464     45.37     0.193    0.4%
 1484      45.4     0.249    0.5%
 1504     45.59     0.174    0.3%
 1524     45.59     0.224    0.4%
 1544     45.84     0.199    0.4%
 1564     45.82     0.161    0.3%
 1584     45.81     0.141    0.3%
 1604     45.89     0.221    0.4%
 1624     45.76     0.136    0.2%
 1644     45.61     0.108    0.2%
 1664     45.96     0.337    0.7%
 1684     45.99     0.172    0.3%
 1704     45.97     0.234    0.5%
 1724     45.78     0.239    0.5%
 1744     45.88     0.181    0.3%
 1764     46.04     0.155    0.3%
 1784     46.12     0.279    0.6%
 1804     46.45     0.191    0.4%
 1824      46.1     0.178    0.3%
 1844     46.29     0.138    0.2%
 1864     46.32     0.137    0.2%
 1884     46.36     0.139    0.2%
 1904     46.45     0.311    0.6%
 1924      46.4     0.121    0.2%
 1944     46.48     0.154    0.3%
 1964     46.57     0.256    0.5%
 1984     46.54     0.168    0.3%
 2004     46.41     0.078    0.1%
 2024     46.52     0.182    0.3%
 2044     46.58     0.105    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=    42.27
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:0)
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.42
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.42
              µs

Reads = 1
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.51
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.51
              µs

Reads = 2
Writes = 1


Parity Bot and others added 6 commits September 18, 2021 02:28
…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
@KiChjang
Copy link
Contributor Author

/benchmark runtime westend runtime_parachains::paras

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 19, 2021

Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=        0
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     53.48     0.148    0.2%
62915     223.1     2.373    1.0%
125829     379.7      4.38    1.1%
188743       534     11.25    2.1%
251657     680.4     1.024    0.1%
314571     846.3     13.31    1.5%
377485     993.4     13.04    1.3%
440399      1166      2.08    0.1%
503313      1308     16.84    1.2%
566227      1452     13.59    0.9%
629141      1612     12.82    0.7%
692055      1767     15.91    0.9%
754969      1925     15.73    0.8%
817883      2082     11.93    0.5%
880797      2231     13.31    0.5%
943711      2396     14.09    0.5%
1006625      2561     19.55    0.7%
1069539      2720     12.35    0.4%
1132453      2880      11.6    0.4%
1195367      3041     3.798    0.1%
1258281      3216     11.24    0.3%
1321195      3363     11.81    0.3%
1384109      3529     7.294    0.2%
1447023      3710     10.03    0.2%
1509937      3857     16.18    0.4%
1572851      4080     6.939    0.1%
1635765      4205     17.07    0.4%
1698679      4377     9.689    0.2%
1761593      4539     11.51    0.2%
1824507      4707     26.96    0.5%
1887421      4860     17.54    0.3%
1950335      5035     14.19    0.2%
2013249      5187     13.51    0.2%
2076163      5358     13.74    0.2%
2139077      5534     14.47    0.2%
2201991      5687      8.31    0.1%
2264905      5864      18.7    0.3%
2327819      6022     12.24    0.2%
2390733      6200     14.07    0.2%
2453647      6404     15.45    0.2%
2516561      6534     17.74    0.2%
2579475      6705     19.23    0.2%
2642389      6876     23.09    0.3%
2705303      7015        22    0.3%
2768217      7183     12.32    0.1%
2831131      7364     24.46    0.3%
2894045      7540     29.58    0.3%
2956959      7712     23.43    0.3%
3019873      7860     25.74    0.3%
3082787      8040     16.85    0.2%
3145701      8169     17.95    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    63.32
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    63.32
              µs

Reads = 0
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.07
    + c    0.001
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     42.18       0.2    0.4%
 1044     43.49     0.416    0.9%
 1064     43.29     0.181    0.4%
 1084     43.41     0.297    0.6%
 1104     43.11     0.139    0.3%
 1124     43.53     0.346    0.7%
 1144     43.39     0.162    0.3%
 1164     43.38     0.196    0.4%
 1184     43.46     0.243    0.5%
 1204     43.79     0.198    0.4%
 1224     43.43      0.19    0.4%
 1244     43.73     0.419    0.9%
 1264     43.67     0.221    0.5%
 1284     43.77     0.198    0.4%
 1304     43.82     0.239    0.5%
 1324     43.76     0.193    0.4%
 1344      43.7      0.18    0.4%
 1364     43.77     0.207    0.4%
 1384     43.86      0.33    0.7%
 1404     43.81     0.188    0.4%
 1424      43.9     0.148    0.3%
 1444     44.04     0.321    0.7%
 1464     44.04     0.238    0.5%
 1484     43.78     0.226    0.5%
 1504     43.95     0.189    0.4%
 1524     44.07      0.12    0.2%
 1544     44.06     0.231    0.5%
 1564     44.27     0.161    0.3%
 1584     44.35     0.212    0.4%
 1604     44.55     0.337    0.7%
 1624      44.4     0.163    0.3%
 1644     44.35     0.191    0.4%
 1664     44.29     0.197    0.4%
 1684      44.7     0.302    0.6%
 1704     44.65     0.093    0.2%
 1724     44.36     0.161    0.3%
 1744     44.37     0.129    0.2%
 1764     44.53     0.148    0.3%
 1784     44.59     0.136    0.3%
 1804      44.7     0.127    0.2%
 1824     44.95     0.267    0.5%
 1844     44.88     0.279    0.6%
 1864     44.88     0.265    0.5%
 1884     44.72     0.159    0.3%
 1904     44.89     0.255    0.5%
 1924     44.99     0.142    0.3%
 1944     44.86     0.186    0.4%
 1964      45.1     0.317    0.7%
 1984     45.28     0.326    0.7%
 2004     44.99     0.245    0.5%
 2024     45.15     0.092    0.2%
 2044     45.13     0.331    0.7%

Quality and confidence:
param     error
c             0

Model:
Time ~=    41.03
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras FutureCodeHash (r:1 w:1)
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras Heads (r:0 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras UpgradeGoAheadSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=       69
              µs

Reads = 6
Writes = 9

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=       69
              µs

Reads = 6
Writes = 9

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.86
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.86
              µs

Reads = 2
Writes = 1


Parity Bot added 2 commits September 19, 2021 15:28
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
// Storage: Paras PastCodeHash (r:0 w:1)
// Storage: Paras CodeByHash (r:0 w:1)
fn force_set_current_code(c: u32, ) -> Weight {
(0 as Weight)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I've no idea what's going on here, this weight is worsened, but force_note_new_head is clearly doing better.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is fine, if the length of code is 0 it shouldn't cost that much more than the storage read and writes I think no ?

@KiChjang
Copy link
Contributor Author

/benchmark runtime kusama runtime_parachains::paras

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 19, 2021

Benchmark Runtime Kusama Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=        0
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     53.13     0.107    0.2%
62915       226     0.763    0.3%
125829       377     0.821    0.2%
188743     527.8      2.68    0.5%
251657     678.7     0.976    0.1%
314571     840.9     15.79    1.8%
377485     991.5      12.7    1.2%
440399      1147      14.9    1.2%
503313      1301     14.02    1.0%
566227      1453     13.76    0.9%
629141      1602      13.2    0.8%
692055      1754     11.43    0.6%
754969      1924     15.04    0.7%
817883      2077     5.211    0.2%
880797      2232      28.5    1.2%
943711      2381     16.42    0.6%
1006625      2548     12.57    0.4%
1069539      2702        17    0.6%
1132453      2871     17.97    0.6%
1195367      3033     15.03    0.4%
1258281      3190     3.303    0.1%
1321195      3358     12.59    0.3%
1384109      3532     8.504    0.2%
1447023      3692     13.69    0.3%
1509937      3863     15.33    0.3%
1572851      4090     21.63    0.5%
1635765      4191     6.654    0.1%
1698679      4344     18.35    0.4%
1761593      4522     15.04    0.3%
1824507      4717     19.88    0.4%
1887421      4852     16.39    0.3%
1950335      5030      14.8    0.2%
2013249      5188     12.07    0.2%
2076163      5352      13.1    0.2%
2139077      5550     18.83    0.3%
2201991      5709     20.69    0.3%
2264905      5872     16.91    0.2%
2327819      6044     24.68    0.4%
2390733      6205     16.66    0.2%
2453647      6348     15.61    0.2%
2516561      6523     17.83    0.2%
2579475      6801     8.027    0.1%
2642389      6957      8.52    0.1%
2705303      7064     27.09    0.3%
2768217      7202     26.32    0.3%
2831131      7347     17.93    0.2%
2894045      7533     24.21    0.3%
2956959      7691     14.65    0.1%
3019873      7860     26.58    0.3%
3082787      8019     20.83    0.2%
3145701      8236     19.22    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    62.82
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    62.82
              µs

Reads = 0
Writes = 1

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.41
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
 1024     43.36     0.121    0.2%
 1044     43.53     0.162    0.3%
 1064     43.57     0.207    0.4%
 1084     43.76      0.16    0.3%
 1104     43.72     0.271    0.6%
 1124      43.7      0.18    0.4%
 1144     43.82     0.209    0.4%
 1164     44.04     0.245    0.5%
 1184     44.05     0.157    0.3%
 1204     43.91     0.329    0.7%
 1224      44.1     0.244    0.5%
 1244     44.06     0.245    0.5%
 1264     43.81     0.103    0.2%
 1284     44.21     0.186    0.4%
 1304     44.18     0.152    0.3%
 1324     44.26     0.217    0.4%
 1344     44.22     0.156    0.3%
 1364     44.25     0.173    0.3%
 1384     44.47     0.241    0.5%
 1404     44.43     0.213    0.4%
 1424     44.42     0.097    0.2%
 1444     44.54     0.349    0.7%
 1464     44.43     0.176    0.3%
 1484     44.41      0.19    0.4%
 1504     44.86     0.251    0.5%
 1524     44.69     0.208    0.4%
 1544     44.74     0.253    0.5%
 1564     44.82     0.169    0.3%
 1584     44.78       0.2    0.4%
 1604     45.04     0.228    0.5%
 1624     44.96      0.15    0.3%
 1644     44.85     0.195    0.4%
 1664     45.19     0.203    0.4%
 1684     45.05     0.245    0.5%
 1704      45.3     0.123    0.2%
 1724      45.2     0.149    0.3%
 1744     45.27     0.262    0.5%
 1764     45.03     0.146    0.3%
 1784     45.13     0.196    0.4%
 1804     45.01     0.067    0.1%
 1824     45.26     0.229    0.5%
 1844     45.67     0.199    0.4%
 1864     45.14     0.189    0.4%
 1884     45.35     0.121    0.2%
 1904     45.31     0.215    0.4%
 1924     45.81     0.165    0.3%
 1944     45.65      0.25    0.5%
 1964     45.51     0.141    0.3%
 1984     45.55     0.174    0.3%
 2004     45.49      0.19    0.4%
 2024     45.49      0.23    0.5%
 2044      45.6     0.108    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=    41.41
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras FutureCodeHash (r:1 w:1)
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras Heads (r:0 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras UpgradeGoAheadSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    69.04
              µs

Reads = 6
Writes = 9

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    69.04
              µs

Reads = 6
Writes = 9

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.97
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.97
              µs

Reads = 2
Writes = 1


…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

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

some benchmark seems not completly accurate, maybe it is negligible or it should be addressed.

runtime/parachains/src/paras/benchmarking.rs Outdated Show resolved Hide resolved
runtime/parachains/src/paras/benchmarking.rs Show resolved Hide resolved
runtime/parachains/src/paras/benchmarking.rs Show resolved Hide resolved
@KiChjang
Copy link
Contributor Author

/benchmark runtime westend runtime_parachains::paras


// 2 ^ 10, because binary search time complexity is O(log(2, n)) and n = 1024 gives us a
// big and round number.
const SAMPLE_SIZE: u32 = 1024;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should say that due to the limited number of parachains, the number of pruning, upcoming upgrades and cooldowns shouldn't exceed this number ?

@KiChjang
Copy link
Contributor Author

/benchmark runtime westend runtime_parachains::paras

Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

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

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 21, 2021

Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=        0
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     53.68     0.329    0.6%
62915     221.8     0.454    0.2%
125829       383     7.354    1.9%
188743     530.8     7.664    1.4%
251657       691     6.953    1.0%
314571     837.3     10.04    1.2%
377485     999.2     14.59    1.4%
440399      1151     17.55    1.5%
503313      1298     13.06    1.0%
566227      1458      12.8    0.8%
629141      1623     10.01    0.6%
692055      1766     11.34    0.6%
754969      1922      13.9    0.7%
817883      2073     13.57    0.6%
880797      2241     7.502    0.3%
943711      2403     14.42    0.6%
1006625      2554     10.81    0.4%
1069539      2713     15.12    0.5%
1132453      2875     6.527    0.2%
1195367      3026     18.17    0.6%
1258281      3197     10.78    0.3%
1321195      3364     12.51    0.3%
1384109      3527     10.83    0.3%
1447023      3698     15.86    0.4%
1509937      3868      18.5    0.4%
1572851      4088     11.08    0.2%
1635765      4197     20.03    0.4%
1698679      4340     14.41    0.3%
1761593      4548     18.62    0.4%
1824507      4714     18.19    0.3%
1887421      4874     16.58    0.3%
1950335      5021     10.57    0.2%
2013249      5193     13.88    0.2%
2076163      5486     83.64    1.5%
2139077      5625     6.956    0.1%
2201991      5707     16.25    0.2%
2264905      5867     26.44    0.4%
2327819      6035     14.42    0.2%
2390733      6194     16.85    0.2%
2453647      6339     13.92    0.2%
2516561      6502     17.11    0.2%
2579475      6694     16.72    0.2%
2642389      6859     14.26    0.2%
2705303      7021     20.93    0.2%
2768217      7214     19.03    0.2%
2831131      7395     36.72    0.4%
2894045      8141     40.27    0.4%
2956959      8295     25.14    0.3%
3019873      8478     11.98    0.1%
3082787      8662     10.62    0.1%
3145701      8651       305    3.5%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.05
    + s    0.001
              µs

Reads = 0 + (0 * s)
Writes = 1 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    1     15.52     0.092    0.5%
20972     39.03     0.197    0.5%
41943     77.31     0.365    0.4%
62914     102.4      0.45    0.4%
83885     132.2     0.109    0.0%
104856     159.3     0.658    0.4%
125827     182.5     0.519    0.2%
146798     206.9     0.417    0.2%
167769     234.5     2.042    0.8%
188740     258.7     0.435    0.1%
209711     287.3     2.703    0.9%
230682     310.9     0.389    0.1%
251653     338.6     4.025    1.1%
272624     363.4     0.459    0.1%
293595     389.2     0.448    0.1%
314566       415     0.506    0.1%
335537     441.3     0.546    0.1%
356508     467.6     1.034    0.2%
377479     500.6     14.09    2.8%
398450     524.1     10.14    1.9%
419421       547     2.251    0.4%
440392     574.2     5.747    1.0%
461363     597.2     0.458    0.0%
482334     643.8     1.992    0.3%
503305     670.6     4.307    0.6%
524276       692     1.685    0.2%
545247     714.8     4.869    0.6%
566218     729.1     4.489    0.6%
587189     760.2     7.589    0.9%
608160     794.6     15.05    1.8%
629131     820.6     14.54    1.7%
650102     831.3     0.678    0.0%
671073     870.7     13.85    1.5%
692044     893.3     12.13    1.3%
713015     919.4     10.54    1.1%
733986     938.5     3.397    0.3%
754957     974.3     13.24    1.3%
775928     995.8     8.537    0.8%
796899      1038     12.57    1.2%
817870      1061     12.97    1.2%
838841      1084     13.94    1.2%
859812      1117      19.2    1.7%
880783      1135     15.56    1.3%
901754      1163     12.99    1.1%
922725      1194     12.67    1.0%
943696      1224     14.63    1.1%
964667      1246     12.81    1.0%
985638      1288     16.73    1.2%
1006609      1305     14.31    1.0%
1027580      1342     16.58    1.2%
1048551      1362     16.78    1.2%

Quality and confidence:
param     error
s             0

Model:
Time ~=    17.52
    + s    0.001
              µs

Reads = 0 + (0 * s)
Writes = 1 + (0 * s)

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=        0
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     76.76     0.159    0.2%
62915     243.5     2.018    0.8%
125829     396.8     0.885    0.2%
188743     555.1     5.569    1.0%
251657     707.4     11.69    1.6%
314571     855.3     9.296    1.0%
377485      1012     11.62    1.1%
440399      1164     13.36    1.1%
503313      1331     12.29    0.9%
566227      1467        11    0.7%
629141      1625     12.54    0.7%
692055      1785     11.48    0.6%
754969      1936     15.83    0.8%
817883      2119     12.92    0.6%
880797      2260     10.39    0.4%
943711      2418     13.12    0.5%
1006625      2579     6.483    0.2%
1069539      2745     14.63    0.5%
1132453      2891     11.19    0.3%
1195367      3064     11.06    0.3%
1258281      3221     12.67    0.3%
1321195      3386     13.72    0.4%
1384109      3579     21.93    0.6%
1447023      3722     16.36    0.4%
1509937      3901     11.49    0.2%
1572851      4115     6.708    0.1%
1635765      4237     17.84    0.4%
1698679      4388     16.81    0.3%
1761593      4546     19.57    0.4%
1824507      4717     12.97    0.2%
1887421      4898     20.95    0.4%
1950335      5068     21.08    0.4%
2013249      5222     16.21    0.3%
2076163      5397     12.54    0.2%
2139077      5574      16.9    0.3%
2201991      5745        17    0.2%
2264905      5907     17.82    0.3%
2327819      6074     15.25    0.2%
2390733      6205     12.35    0.1%
2453647      6381     10.35    0.1%
2516561      6564     18.45    0.2%
2579475      6751     22.63    0.3%
2642389      7445     11.85    0.1%
2705303      7638     17.64    0.2%
2768217      7819     18.09    0.2%
2831131      8004     17.15    0.2%
2894045      8183     16.58    0.2%
2956959      8347     17.83    0.2%
3019873      8549      35.6    0.4%
3082787      8736     21.93    0.2%
3145701      8639     336.8    3.8%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras FutureCodeHash (r:1 w:1)
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras Heads (r:0 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras UpgradeGoAheadSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.67
    + s    0.001
              µs

Reads = 6 + (0 * s)
Writes = 9 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    1     67.51     0.151    0.2%
20972     91.24     0.837    0.9%
41943     131.1     0.276    0.2%
62914     158.8     0.354    0.2%
83885     182.1      0.27    0.1%
104856       214     0.472    0.2%
125827     236.5     0.561    0.2%
146798     264.2     11.08    4.1%
167769     287.1     0.513    0.1%
188740     315.6     3.289    1.0%
209711     339.2       0.7    0.2%
230682     375.3     10.15    2.7%
251653     391.2     0.553    0.1%
272624     417.6     0.435    0.1%
293595     443.9     0.802    0.1%
314566       480     10.01    2.0%
335537     498.3     6.027    1.2%
356508     521.3     0.477    0.0%
377479     546.8     0.671    0.1%
398450     579.5     10.24    1.7%
419421     607.3     11.04    1.8%
440392     629.2     6.713    1.0%
461363     658.5     11.99    1.8%
482334     678.4     1.478    0.2%
503305     711.4     13.67    1.9%
524276     730.2     0.796    0.1%
545247     772.2     16.73    2.1%
566218     783.7     4.697    0.5%
587189     808.2     0.792    0.0%
608160     846.8     15.12    1.7%
629131     894.2     12.08    1.3%
650102     912.7     3.133    0.3%
671073     926.2     13.51    1.4%
692044     954.7     14.74    1.5%
713015     982.7      14.1    1.4%
733986      1003     14.36    1.4%
754957      1038      16.2    1.5%
775928      1057     15.58    1.4%
796899      1079     12.04    1.1%
817870      1098     2.437    0.2%
838841      1135     13.02    1.1%
859812      1157     4.313    0.3%
880783      1195     13.59    1.1%
901754      1218     13.39    1.0%
922725      1252     15.16    1.2%
943696      1285     14.72    1.1%
964667      1301     14.27    1.0%
985638      1337      12.8    0.9%
1006609      1363     15.57    1.1%
1027580      1398     17.34    1.2%
1048551      1434     12.65    0.8%

Quality and confidence:
param     error
s             0

Model:
Time ~=    71.15
    + s    0.001
              µs

Reads = 6 + (0 * s)
Writes = 9 + (0 * s)

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    27.23
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    27.23
              µs

Reads = 2
Writes = 1


Parity Bot added 2 commits September 21, 2021 13:31
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
@KiChjang
Copy link
Contributor Author

/benchmark runtime kusama runtime_parachains::paras

@parity-benchapp
Copy link

parity-benchapp bot commented Sep 21, 2021

Benchmark Runtime Kusama Pallet for branch "kckyeung/parachains-paras-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs

Results
Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras CodeByHash (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=        0
    + c    0.002
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     53.76     0.205    0.3%
62915     222.7     0.816    0.3%
125829     386.1     0.939    0.2%
188743     527.8      1.59    0.3%
251657     691.8     15.69    2.2%
314571     848.7     13.73    1.6%
377485     989.3     8.851    0.8%
440399      1139      7.21    0.6%
503313      1303     17.37    1.3%
566227      1449     15.59    1.0%
629141      1612     13.46    0.8%
692055      1766     15.33    0.8%
754969      1917     15.44    0.8%
817883      2087     16.41    0.7%
880797      2225      18.3    0.8%
943711      2391     15.85    0.6%
1006625      2544     12.11    0.4%
1069539      2703     14.11    0.5%
1132453      2874     7.153    0.2%
1195367      3036     9.508    0.3%
1258281      3210     18.42    0.5%
1321195      3363     13.06    0.3%
1384109      3534     16.83    0.4%
1447023      3685     11.18    0.3%
1509937      3869     16.25    0.4%
1572851      4079     12.57    0.3%
1635765      4192     14.39    0.3%
1698679      4364     16.64    0.3%
1761593      4510     10.29    0.2%
1824507      4695     10.72    0.2%
1887421      4865     19.63    0.4%
1950335      5020     8.609    0.1%
2013249      5193     18.17    0.3%
2076163      5359     13.13    0.2%
2139077      5506     10.57    0.1%
2201991      5687     10.57    0.1%
2264905      5851     20.84    0.3%
2327819      6027      23.1    0.3%
2390733      6200     19.76    0.3%
2453647      6356     28.22    0.4%
2516561      6506       9.4    0.1%
2579475      6686     12.71    0.1%
2642389      6864     19.41    0.2%
2705303      7034     13.77    0.1%
2768217      7195     21.63    0.3%
2831131      7375     31.41    0.4%
2894045      7538     29.52    0.3%
2956959      7680     14.89    0.1%
3019873      7862     34.17    0.4%
3082787      8030      20.2    0.2%
3145701      8217     13.58    0.1%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 4 + (0 * c)
Writes = 6 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_set_current_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras Heads (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.75
    + s    0.001
              µs

Reads = 0 + (0 * s)
Writes = 1 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    1     15.37     0.068    0.4%
20972     38.68     0.101    0.2%
41943     77.21     0.311    0.4%
62914     102.5     0.638    0.6%
83885     130.9     1.591    1.2%
104856       156      0.26    0.1%
125827     183.9     3.799    2.0%
146798       207     0.119    0.0%
167769     238.4     0.355    0.1%
188740     259.5     0.335    0.1%
209711     285.2     0.274    0.0%
230682     310.6     0.207    0.0%
251653     337.2     0.526    0.1%
272624     365.4      4.11    1.1%
293595     389.3      0.38    0.0%
314566     415.1     0.256    0.0%
335537     442.5     3.751    0.8%
356508     467.1     0.388    0.0%
377479     496.8     5.094    1.0%
398450     522.9     6.574    1.2%
419421     558.2     15.87    2.8%
440392     571.5     0.336    0.0%
461363       599     3.686    0.6%
482334     625.1     2.613    0.4%
503305     655.8     7.803    1.1%
524276     683.2     13.41    1.9%
545247     704.3     8.877    1.2%
566218     735.1     12.79    1.7%
587189     756.7      9.35    1.2%
608160     786.3     8.353    1.0%
629131     812.4     12.09    1.4%
650102     844.6     14.82    1.7%
671073     872.8     15.61    1.7%
692044     887.1     3.666    0.4%
713015     918.3     11.01    1.1%
733986     939.2     2.357    0.2%
754957     978.7     12.03    1.2%
775928      1015     15.81    1.5%
796899      1036     14.58    1.4%
817870      1062     15.87    1.4%
838841      1079     10.86    1.0%
859812      1105     12.05    1.0%
880783      1141     13.09    1.1%
901754      1162     14.98    1.2%
922725      1188      13.7    1.1%
943696      1224     15.48    1.2%
964667      1246     12.13    0.9%
985638      1278     16.58    1.2%
1006609      1306     15.13    1.1%
1027580      1337      14.6    1.0%
1048551      1387     14.46    1.0%

Quality and confidence:
param     error
s             0

Model:
Time ~=    16.08
    + s    0.001
              µs

Reads = 0 + (0 * s)
Writes = 1 + (0 * s)

Pallet: "runtime_parachains::paras", Extrinsic: "force_schedule_code_upgrade", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Configuration ActiveConfig (r:1 w:0)
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras UpcomingUpgrades (r:1 w:1)
Storage: Paras UpgradeCooldowns (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras CodeByHashRefs (r:1 w:1)
Storage: Paras CodeByHash (r:0 w:1)
Storage: Paras FutureCodeHash (r:0 w:1)
Storage: Paras UpgradeRestrictionSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    2.422
    + c    0.002
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    1     76.38     0.276    0.3%
62915       239     0.198    0.0%
125829     396.5     0.642    0.1%
188743     544.9     0.693    0.1%
251657     701.3     5.581    0.7%
314571     857.1     11.21    1.3%
377485      1007     11.25    1.1%
440399      1158     9.848    0.8%
503313      1323     13.62    1.0%
566227      1476     16.31    1.1%
629141      1631     12.29    0.7%
692055      1777     14.51    0.8%
754969      1969     2.148    0.1%
817883      2129     3.312    0.1%
880797      2291     6.326    0.2%
943711      2404     14.91    0.6%
1006625      2570     10.19    0.3%
1069539      2725     18.26    0.6%
1132453      2887     11.79    0.4%
1195367      3050     9.657    0.3%
1258281      3225       8.9    0.2%
1321195      3399     19.43    0.5%
1384109      3559     8.474    0.2%
1447023      3707     9.335    0.2%
1509937      3901     8.736    0.2%
1572851      4100     25.55    0.6%
1635765      4222     17.17    0.4%
1698679      4388     14.82    0.3%
1761593      4557     16.24    0.3%
1824507      4713     12.43    0.2%
1887421      4901     21.69    0.4%
1950335      5063     15.48    0.3%
2013249      5251     16.03    0.3%
2076163      5384     10.17    0.1%
2139077      5566     13.99    0.2%
2201991      5724     15.51    0.2%
2264905      5895     11.68    0.1%
2327819      6172     18.78    0.3%
2390733      6251     16.25    0.2%
2453647      6396     20.38    0.3%
2516561      6561     11.82    0.1%
2579475      6731     17.53    0.2%
2642389      6922     15.56    0.2%
2705303      7075     20.59    0.2%
2768217      7231     20.55    0.2%
2831131      7391     16.77    0.2%
2894045      7578     27.08    0.3%
2956959      7720     23.58    0.3%
3019873      7874     19.12    0.2%
3082787      8056     18.07    0.2%
3145701      8241     23.73    0.2%

Quality and confidence:
param     error
c             0

Model:
Time ~=        0
    + c    0.003
              µs

Reads = 6 + (0 * c)
Writes = 8 + (0 * c)

Pallet: "runtime_parachains::paras", Extrinsic: "force_note_new_head", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Paras FutureCodeUpgrades (r:1 w:1)
Storage: Paras FutureCodeHash (r:1 w:1)
Storage: Paras CurrentCodeHash (r:1 w:1)
Storage: System Digest (r:1 w:1)
Storage: Paras PastCodeMeta (r:1 w:1)
Storage: Paras PastCodePruning (r:1 w:1)
Storage: Paras Heads (r:0 w:1)
Storage: Paras PastCodeHash (r:0 w:1)
Storage: Paras UpgradeGoAheadSignal (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.12
    + s    0.001
              µs

Reads = 6 + (0 * s)
Writes = 9 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    1     68.08     0.199    0.2%
20972     92.83     0.215    0.2%
41943     132.6     0.346    0.2%
62914     158.4     1.697    1.0%
83885     185.3     1.518    0.8%
104856       210      0.29    0.1%
125827     239.7     2.257    0.9%
146798     261.1     0.373    0.1%
167769     287.3     0.512    0.1%
188740     318.1      9.56    3.0%
209711     339.5     0.684    0.2%
230682       365     0.356    0.0%
251653     390.9     0.283    0.0%
272624     417.5      0.63    0.1%
293595       445     3.952    0.8%
314566     470.7     3.885    0.8%
335537     498.8     8.509    1.7%
356508     521.9     0.439    0.0%
377479     547.4     0.259    0.0%
398450       576     4.937    0.8%
419421     599.9     0.561    0.0%
440392     634.7     10.58    1.6%
461363     655.2     5.985    0.9%
482334     681.6     8.799    1.2%
503305     712.8     14.17    1.9%
524276     734.6     8.958    1.2%
545247     762.1     8.752    1.1%
566218     782.1     0.854    0.1%
587189     837.5     11.99    1.4%
608160       833      1.02    0.1%
629131     861.1     0.916    0.1%
650102     890.8     8.878    0.9%
671073     919.2     10.96    1.1%
692044     948.3     14.16    1.4%
713015     968.7     6.712    0.6%
733986     993.9     1.427    0.1%
754957      1031     11.18    1.0%
775928      1055     12.11    1.1%
796899      1088     13.71    1.2%
817870      1101     1.815    0.1%
838841      1145     15.51    1.3%
859812      1174     13.66    1.1%
880783      1191     11.54    0.9%
901754      1219     12.36    1.0%
922725      1252     13.63    1.0%
943696      1281     13.49    1.0%
964667      1317     10.69    0.8%
985638      1340     15.29    1.1%
1006609      1364     14.15    1.0%
1027580      1398        13    0.9%
1048551      1439     13.32    0.9%

Quality and confidence:
param     error
s             0

Model:
Time ~=    69.11
    + s    0.001
              µs

Reads = 6 + (0 * s)
Writes = 9 + (0 * s)

Pallet: "runtime_parachains::paras", Extrinsic: "force_queue_action", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ParasShared CurrentSessionIndex (r:1 w:0)
Storage: Paras ActionsQueue (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    26.75
              µs

Reads = 2
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    26.75
              µs

Reads = 2
Writes = 1


Parity Bot and others added 3 commits September 21, 2021 19:25
…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
@KiChjang
Copy link
Contributor Author

bot merge

@ghost
Copy link

ghost commented Sep 22, 2021

Trying merge.

@ghost ghost merged commit e9c4bc1 into master Sep 22, 2021
@ghost ghost deleted the kckyeung/parachains-paras-benchmarking branch September 22, 2021 01:14
}
force_queue_action {
let para_id = ParaId::from(1000);
generate_disordered_actions_queue::<T>();
Copy link
Contributor

Choose a reason for hiding this comment

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

generate_disordered_actions_queue fills up the actions queue with para id 1000, meaning a binary search for 1000 would be O(1) right? Would it be better to fill up the actions queue with anything but the id we are adding so we have to do a full binary search?

ordian added a commit that referenced this pull request Sep 24, 2021
* master:
  Companion for Generate storage info for pallet grandpa #9817 (#3892)
  add tracing to assignment criteria (#3886)
  Add benchmarking for parachain runtime paras pallet (#3888)
  companion for substrate#9788 (#3858)
  Substrate Companion for #9566 (#3704)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants