Skip to content

Conversation

@ukby1234
Copy link
Contributor

@ukby1234 ukby1234 commented Dec 8, 2021

update stable asset benchmarks

@ukby1234 ukby1234 requested review from xlc and zjb0807 December 8, 2021 08:52
@xlc xlc requested a review from ferrell-code December 8, 2021 09:29
@ferrell-code
Copy link
Contributor

/bench runtime mandala nutsfinance_stable_asset

@ghost
Copy link

ghost commented Dec 8, 2021

Finished benchmark for branch: stable-asset-update

Benchmark: Benchmark Runtime Mandala Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=nutsfinance_stable_asset --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/

Results

Pallet: "nutsfinance_stable_asset", Extrinsic: "create_pool", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset PoolCount (r:1 w:1)
Storage: StableAsset Pools (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 41.98
µs

Reads = 3
Writes = 3

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 41.98
µs

Reads = 3
Writes = 3

Pallet: "nutsfinance_stable_asset", Extrinsic: "modify_a", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 30.63
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 30.63
µs

Reads = 1
Writes = 1

Pallet: "nutsfinance_stable_asset", Extrinsic: "mint", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)
Storage: System Account (r:2 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 142
+ u 39.29
µs

Reads = 8 + (2 * u)
Writes = 6 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 220.3 1.682 0.7%
3 261.2 1.99 0.7%
4 299.4 1.87 0.6%
5 338.4 2.451 0.7%

Quality and confidence:
param error
u 0.305

Model:
Time ~= 142.5
+ u 39.25
µs

Reads = 8 + (2 * u)
Writes = 6 + (2 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "swap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:5 w:5)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 145.2
µs

Reads = 9
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 145.2
µs

Reads = 9
Writes = 7

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_proportion", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 113.6
+ u 32.16
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 178.1 0.459 0.2%
3 211.6 4.547 2.1%
4 236.8 0.508 0.2%
5 289.9 16.63 5.7%

Quality and confidence:
param error
u 1.556

Model:
Time ~= 102.9
+ u 36.06
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_single", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:5 w:4)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 161.1
µs

Reads = 9
Writes = 6

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 161.1
µs

Reads = 9
Writes = 6

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_multi", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 100.2
+ u 29.22
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 158.2 0.443 0.2%
3 188.3 0.305 0.1%
4 216.5 0.85 0.3%
5 246.3 0.517 0.2%

Quality and confidence:
param error
u 0.1

Model:
Time ~= 100
+ u 29.23
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=nutsfinance_stable_asset --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/
@ferrell-code
Copy link
Contributor

Well that is an ugly output, I will fix the handlebars file

…ime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=nutsfinance_stable_asset --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/"

This reverts commit 910614c.
@ferrell-code
Copy link
Contributor

ferrell-code commented Dec 9, 2021

Just a few comments... overall looks good!

Also merge master, so we can get the benchbot to benchmark now that handlebars template files are working again

@ferrell-code
Copy link
Contributor

Nit, while I believe this is safe as usize and u32 are the same in the wasm environment I still prefer something like T::PoolAssetLimit::get().try_into().map_err(|_| ArithmeticError::Overflow)?;

ensure!(
	assets.len() <= T::PoolAssetLimit::get().try_into().unwrap(),
	Error::<T>::ArgumentsError
);

@ferrell-code
Copy link
Contributor

/bench runtime mandala nutsfinance_stable_asset

@ghost
Copy link

ghost commented Dec 12, 2021

Finished benchmark for branch: stable-asset-update

Benchmark: Benchmark Runtime Mandala Module

cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=nutsfinance_stable_asset --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/

Results

Pallet: "nutsfinance_stable_asset", Extrinsic: "create_pool", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset PoolCount (r:1 w:1)
Storage: StableAsset Pools (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 42.31
µs

Reads = 3
Writes = 3

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 42.31
µs

Reads = 3
Writes = 3

Pallet: "nutsfinance_stable_asset", Extrinsic: "modify_a", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 31.58
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 31.58
µs

Reads = 1
Writes = 1

Pallet: "nutsfinance_stable_asset", Extrinsic: "mint", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)
Storage: System Account (r:2 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 140.5
+ u 40.23
µs

Reads = 8 + (2 * u)
Writes = 6 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 220.9 0.631 0.2%
3 261.7 1.09 0.4%
4 301.4 0.947 0.3%
5 342 1.426 0.4%

Quality and confidence:
param error
u 0.156

Model:
Time ~= 140.4
+ u 40.3
µs

Reads = 8 + (2 * u)
Writes = 6 + (2 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "swap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:5 w:5)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 125
+ u 11.21
µs

Reads = 7 + (1 * u)
Writes = 7 + (0 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 147.6 0.293 0.1%
3 158.7 0.483 0.3%
4 169.2 0.535 0.3%
5 181.5 0.438 0.2%

Quality and confidence:
param error
u 0.088

Model:
Time ~= 125
+ u 11.22
µs

Reads = 7 + (1 * u)
Writes = 7 + (0 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_proportion", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 122.4
+ u 30.22
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 182.7 0.674 0.3%
3 214.3 1.465 0.6%
4 241.1 0.54 0.2%
5 274.5 0.852 0.3%

Quality and confidence:
param error
u 0.239

Model:
Time ~= 122.3
+ u 30.25
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_single", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:5 w:4)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 149.2
+ u 8.078
µs

Reads = 7 + (1 * u)
Writes = 6 + (0 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 167 1.858 1.1%
3 154.7 0.761 0.4%
4 187.8 0.603 0.3%
5 178.7 1.316 0.7%

Quality and confidence:
param error
u 1.434

Model:
Time ~= 148.2
+ u 6.816
µs

Reads = 7 + (1 * u)
Writes = 6 + (0 * u)

Pallet: "nutsfinance_stable_asset", Extrinsic: "redeem_multi", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info

Storage: StableAsset Pools (r:1 w:1)
Storage: Tokens Accounts (r:6 w:6)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:2 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 102.1
+ u 30.61
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
u mean µs sigma µs %
2 163.1 0.342 0.2%
3 194.4 0.805 0.4%
4 223.1 0.806 0.3%
5 255.9 1.013 0.3%

Quality and confidence:
param error
u 0.167

Model:
Time ~= 101.7
+ u 30.69
µs

Reads = 6 + (2 * u)
Writes = 4 + (2 * u)

…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=nutsfinance_stable_asset --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/
@ukby1234 ukby1234 merged commit ef36c88 into master Dec 12, 2021
@ukby1234 ukby1234 deleted the stable-asset-update branch December 12, 2021 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants