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

optimize internal swap #1704

Merged
merged 12 commits into from
Dec 18, 2021
Merged

optimize internal swap #1704

merged 12 commits into from
Dec 18, 2021

Conversation

wangjj9219
Copy link
Member

  1. cdp-treausury swap collateral to stable by the path with best price.
  2. simplify code

@xlc xlc requested review from ferrell-code and shaunxw December 16, 2021 00:45
modules/cdp-engine/src/lib.rs Outdated Show resolved Hide resolved
xlc
xlc previously approved these changes Dec 16, 2021
@xlc xlc self-requested a review December 16, 2021 09:10
@xlc
Copy link
Member

xlc commented Dec 16, 2021

Needs rebench

@wangjj9219
Copy link
Member Author

/bench runtime acala module_honzon

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

Benchmark: Benchmark Runtime Acala Module

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

Results

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 56.96
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 56.96
µs

Reads = 2
Writes = 2

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 58.39
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 58.39
µs

Reads = 2
Writes = 2

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

Storage: Balances Reserves (r:1 w:0)
Storage: Honzon Authorization (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 29.07
+ c 32.76
µs

Reads = 1 + (0 * c)
Writes = 0 + (2 * c)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 29.02 0.296 1.0%
1 61.86 0.374 0.6%

Quality and confidence:
param error
c 0.159

Model:
Time ~= 29.02
+ c 32.83
µs

Reads = 1 + (0 * c)
Writes = 0 + (2 * c)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: Tokens Accounts (r:3 w:3)
Storage: System Account (r:1 w:1)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:1)
Storage: OperatorMembershipAcala Members (r:1 w:0)
Storage: AcalaOracle RawValues (r:6 w:0)
Storage: AcalaOracle Values (r:1 w:1)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 256.7
µs

Reads = 24
Writes = 11

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 256.7
µs

Reads = 24
Writes = 11

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Honzon Authorization (r:1 w:0)
Storage: Loans Positions (r:2 w:2)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Rewards SharesAndWithdrawnRewards (r:2 w:2)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 152.9
µs

Reads = 15
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 152.9
µs

Reads = 15
Writes = 7

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:3 w:2)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:2 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 419.7
µs

Reads = 29
Writes = 15

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 419.7
µs

Reads = 29
Writes = 15

Acala Benchmarking Bot added 2 commits December 17, 2021 05:55
…hmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_honzon --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/
@wangjj9219
Copy link
Member Author

/bench runtime karura module_honzon

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

Benchmark: Benchmark Runtime Karura Module

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

Results

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 52.34
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 52.34
µs

Reads = 2
Writes = 2

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 53.72
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 53.72
µs

Reads = 2
Writes = 2

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

Storage: Balances Reserves (r:1 w:0)
Storage: Honzon Authorization (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 28.39
+ c 16.04
µs

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

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 27.24 0.212 0.7%
1 56.73 0.428 0.7%
2 59.48 0.469 0.7%

Quality and confidence:
param error
c 1.461

Model:
Time ~= 31.7
+ c 16.11
µs

Reads = 1 + (0 * c)
Writes = 0 + (2 * c)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: Tokens Accounts (r:3 w:3)
Storage: System Account (r:1 w:1)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:1)
Storage: OperatorMembershipAcala Members (r:1 w:0)
Storage: AcalaOracle RawValues (r:6 w:0)
Storage: AcalaOracle Values (r:1 w:1)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 445.5
µs

Reads = 24
Writes = 11

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 445.5
µs

Reads = 24
Writes = 11

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Honzon Authorization (r:1 w:0)
Storage: Loans Positions (r:2 w:2)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Rewards SharesAndWithdrawnRewards (r:2 w:2)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 140
µs

Reads = 15
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 140
µs

Reads = 15
Writes = 7

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:3 w:2)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:2 w:2)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 422.1
µs

Reads = 31
Writes = 16

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 422.1
µs

Reads = 31
Writes = 16

…hmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_honzon --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/
@wangjj9219
Copy link
Member Author

/bench runtime mandala module_honzon

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

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=module_honzon --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/

Results

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 52.4
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 52.4
µs

Reads = 2
Writes = 2

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

Storage: Honzon Authorization (r:1 w:1)
Storage: Balances Reserves (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 54.41
µs

Reads = 2
Writes = 2

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 54.41
µs

Reads = 2
Writes = 2

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

Storage: Balances Reserves (r:1 w:0)
Storage: Honzon Authorization (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 28.47
+ c 16.6
µs

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

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 27.08 0.373 1.3%
1 58.21 0.572 0.9%
2 60.41 0.519 0.8%

Quality and confidence:
param error
c 1.582

Model:
Time ~= 31.9
+ c 16.66
µs

Reads = 1 + (0 * c)
Writes = 0 + (2 * c)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: Tokens Accounts (r:3 w:3)
Storage: System Account (r:1 w:1)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:1)
Storage: OperatorMembershipAcala Members (r:1 w:0)
Storage: AcalaOracle RawValues (r:3 w:0)
Storage: AcalaOracle Values (r:1 w:1)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 220.6
µs

Reads = 21
Writes = 11

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 220.6
µs

Reads = 21
Writes = 11

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Honzon Authorization (r:1 w:0)
Storage: Loans Positions (r:2 w:2)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Rewards SharesAndWithdrawnRewards (r:2 w:2)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: System Account (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 140.2
µs

Reads = 15
Writes = 7

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 140.2
µs

Reads = 15
Writes = 7

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: StakingPool StakingPoolLedger (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:3 w:2)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:3 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 385.5
µs

Reads = 30
Writes = 15

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 385.5
µs

Reads = 30
Writes = 15

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

/bench runtime acala module_cdp_engine

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

Benchmark: Benchmark Runtime Acala Module

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

Results

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

Storage: CdpEngine LastAccumulationSecs (r:1 w:1)
Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: CdpEngine CollateralParams (r:2 w:0)
Storage: CdpEngine GlobalInterestRatePerSec (r:1 w:0)
Storage: Loans TotalPositions (r:2 w:0)
Storage: Timestamp Now (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 32.6
+ c 4.917
µs

Reads = 7 + (0 * c)
Writes = 2 + (0 * c)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 32.77 0.787 2.4%
1 37.68 0.462 1.2%

Quality and confidence:
param error
c 0.304

Model:
Time ~= 32.77
+ c 4.915
µs

Reads = 7 + (0 * c)
Writes = 2 + (0 * c)

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

Storage: CdpEngine CollateralParams (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 55.92
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 55.92
µs

Reads = 1
Writes = 1

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

Storage: CdpEngine GlobalInterestRatePerSec (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.01
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.01
µs

Reads = 0
Writes = 1

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:3 w:3)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:1)
Storage: Dex TradingPairStatuses (r:2 w:0)
Storage: CdpTreasury ExpectedCollateralAuctionSize (r:1 w:0)
Storage: AuctionManager TotalTargetInAuction (r:1 w:1)
Storage: Auction AuctionsIndex (r:1 w:1)
Storage: AuctionManager CollateralAuctions (r:0 w:1)
Storage: Auction AuctionEndTime (r:0 w:1)
Storage: Auction Auctions (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 268.2
+ b 27.81
µs

Reads = 23 + (0 * b)
Writes = 16 + (3 * b)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
b mean µs sigma µs %
1 282.3 1.674 0.5%
2 306.3 1.108 0.3%
3 362.9 2.567 0.7%
4 362.3 1.893 0.5%
5 393 5.534 1.4%
6 440.6 1.384 0.3%
7 468.7 0.851 0.1%
8 469.3 0.857 0.1%
9 525.1 1.23 0.2%
10 525 1.795 0.3%
11 576.3 2.743 0.4%
12 601.6 0.871 0.1%
13 645.3 8.411 1.3%
14 665.5 2.767 0.4%
15 689.8 4.948 0.7%
16 692.1 5.013 0.7%
17 749.2 7.839 1.0%
18 770.4 4.396 0.5%
19 800.8 5.423 0.6%
20 804.7 8.147 1.0%
21 862.5 11.33 1.3%
22 885.8 8.391 0.9%
23 916.1 8.173 0.8%
24 942.4 7.672 0.8%
25 933.5 3.266 0.3%
26 992.2 6.185 0.6%
27 1025 9.329 0.9%
28 1062 15.73 1.4%
29 1072 6.195 0.5%
30 1110 7.705 0.6%
31 1125 4.596 0.4%
32 1126 3.316 0.2%
33 1190 7.285 0.6%
34 1216 4.972 0.4%
35 1248 5.185 0.4%
36 1271 4.107 0.3%
37 1323 11.91 0.9%
38 1363 10.94 0.8%
39 1389 27.61 1.9%
40 1351 4.98 0.3%
41 1416 17.78 1.2%
42 1447 9.147 0.6%
43 1456 4.507 0.3%
44 1488 8.027 0.5%
45 1517 10.03 0.6%
46 1540 5.197 0.3%
47 1578 7.96 0.5%
48 1600 6.412 0.4%
49 1625 9.757 0.6%
50 1625 4.991 0.3%

Quality and confidence:
param error
b 0.053

Model:
Time ~= 264.8
+ b 27.91
µs

Reads = 23 + (0 * b)
Writes = 15 + (3 * b)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:4 w:3)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:2 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 415.6
µs

Reads = 30
Writes = 16

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 415.6
µs

Reads = 30
Writes = 16

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:2 w:1)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 165.9
µs

Reads = 13
Writes = 8

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 165.9
µs

Reads = 13
Writes = 8

…hmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_cdp_engine --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/
@wangjj9219
Copy link
Member Author

/bench runtime karura module_cdp_engine

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

Benchmark: Benchmark Runtime Karura Module

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

Results

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

Storage: CdpEngine LastAccumulationSecs (r:1 w:1)
Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: CdpEngine CollateralParams (r:3 w:0)
Storage: CdpEngine GlobalInterestRatePerSec (r:1 w:0)
Storage: Loans TotalPositions (r:3 w:0)
Storage: Timestamp Now (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 39.05
+ c 4.414
µs

Reads = 9 + (0 * c)
Writes = 2 + (0 * c)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 38.82 0.22 0.5%
1 44.19 0.558 1.2%
2 47.73 0.218 0.4%

Quality and confidence:
param error
c 0.131

Model:
Time ~= 39.13
+ c 4.457
µs

Reads = 9 + (0 * c)
Writes = 2 + (0 * c)

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

Storage: CdpEngine CollateralParams (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 56.9
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 56.9
µs

Reads = 1
Writes = 1

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

Storage: CdpEngine GlobalInterestRatePerSec (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 18.52
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 18.52
µs

Reads = 0
Writes = 1

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:3 w:3)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:1)
Storage: Dex TradingPairStatuses (r:2 w:0)
Storage: CdpTreasury ExpectedCollateralAuctionSize (r:1 w:0)
Storage: AuctionManager TotalTargetInAuction (r:1 w:1)
Storage: Auction AuctionsIndex (r:1 w:1)
Storage: AuctionManager CollateralAuctions (r:0 w:1)
Storage: EvmAccounts Accounts (r:0 w:1)
Storage: Auction AuctionEndTime (r:0 w:1)
Storage: Auction Auctions (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 281.6
+ b 28.41
µs

Reads = 25 + (0 * b)
Writes = 17 + (3 * b)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
b mean µs sigma µs %
1 333.5 30.52 9.1%
2 320.4 0.999 0.3%
3 373.6 1.423 0.3%
4 382.4 8.257 2.1%
5 404.4 2.511 0.6%
6 460 3.668 0.7%
7 487.1 3.142 0.6%
8 486.7 2.203 0.4%
9 543.4 5.988 1.1%
10 541.1 3.392 0.6%
11 599.8 5.318 0.8%
12 621.9 1.872 0.3%
13 661.8 7.391 1.1%
14 707.1 11.85 1.6%
15 1047 174.3 16.6%
16 722.2 9.977 1.3%
17 766.4 6.862 0.8%
18 797 5.794 0.7%
19 825 7.352 0.8%
20 819 3.673 0.4%
21 874.4 2.841 0.3%
22 907.6 6.585 0.7%
23 934.4 5.856 0.6%
24 966.8 8.582 0.8%
25 961.7 5.417 0.5%
26 1016 4.131 0.4%
27 1055 6.194 0.5%
28 1076 5.622 0.5%
29 1106 8.358 0.7%
30 1135 6.489 0.5%
31 1166 7.698 0.6%
32 1157 2.784 0.2%
33 1222 6.746 0.5%
34 1291 67.49 5.2%
35 1307 6.559 0.5%
36 1308 7.055 0.5%
37 1363 11.2 0.8%
38 1374 14.34 1.0%
39 1389 5.903 0.4%
40 1391 4.801 0.3%
41 1445 8.235 0.5%
42 1471 6.593 0.4%
43 1497 4.372 0.2%
44 1532 8.027 0.5%
45 1556 7.523 0.4%
46 1593 5.995 0.3%
47 1625 8.931 0.5%
48 1650 7.629 0.4%
49 1674 4.431 0.2%
50 1677 12.22 0.7%

Quality and confidence:
param error
b 0.177

Model:
Time ~= 295.1
+ b 28.13
µs

Reads = 25 + (0 * b)
Writes = 16 + (3 * b)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: HomaLite TotalStakingCurrency (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:4 w:3)
Storage: EvmAccounts EvmAddresses (r:1 w:0)
Storage: EVM Accounts (r:1 w:0)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:2 w:2)
Storage: EvmAccounts Accounts (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 436.7
µs

Reads = 32
Writes = 17

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 436.7
µs

Reads = 32
Writes = 17

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:2 w:1)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 155.1
µs

Reads = 13
Writes = 8

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 155.1
µs

Reads = 13
Writes = 8

…hmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_cdp_engine --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/
@wangjj9219
Copy link
Member Author

/bench runtime mandala module_cdp_engine

@ghost
Copy link

ghost commented Dec 17, 2021

Finished benchmark for branch: optimize-internal-swap

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=module_cdp_engine --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/

Results

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

Storage: CdpEngine LastAccumulationSecs (r:1 w:1)
Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: CdpEngine CollateralParams (r:3 w:0)
Storage: CdpEngine GlobalInterestRatePerSec (r:1 w:0)
Storage: Loans TotalPositions (r:3 w:0)
Storage: Timestamp Now (r:0 w:1)
Storage: CdpEngine DebitExchangeRate (r:1 w:1)
Storage: Tokens Accounts (r:1 w:1)
Storage: Tokens TotalIssuance (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 46.04
+ c 46.02
µs

Reads = 9 + (2 * c)
Writes = 2 + (2 * c)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
c mean µs sigma µs %
0 45.16 0.155 0.3%
1 100.4 0.368 0.3%
2 137.5 0.392 0.2%

Quality and confidence:
param error
c 0.991

Model:
Time ~= 48.18
+ c 46.21
µs

Reads = 9 + (2 * c)
Writes = 2 + (2 * c)

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

Storage: CdpEngine CollateralParams (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 57.13
µs

Reads = 1
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 57.13
µs

Reads = 1
Writes = 1

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

Storage: CdpEngine GlobalInterestRatePerSec (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 19.64
µs

Reads = 0
Writes = 1

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 19.64
µs

Reads = 0
Writes = 1

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:3 w:3)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:1)
Storage: Dex TradingPairStatuses (r:1 w:0)
Storage: Dex LiquidityPool (r:1 w:0)
Storage: CdpTreasury ExpectedCollateralAuctionSize (r:1 w:0)
Storage: AuctionManager TotalTargetInAuction (r:1 w:1)
Storage: Auction AuctionsIndex (r:1 w:1)
Storage: AuctionManager CollateralAuctions (r:0 w:1)
Storage: Auction AuctionEndTime (r:0 w:1)
Storage: Auction Auctions (r:0 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 270.5
+ b 28.27
µs

Reads = 23 + (0 * b)
Writes = 16 + (3 * b)

Min Squares Analysis

-- Extrinsic Time --

Data points distribution:
b mean µs sigma µs %
1 284 4.738 1.6%
2 311.2 10.63 3.4%
3 642.6 6.878 1.0%
4 359.6 1.615 0.4%
5 510.9 94.72 18.5%
6 444.2 2.105 0.4%
7 496.8 34.93 7.0%
8 488.6 10.02 2.0%
9 526.4 1.276 0.2%
10 526.4 1.927 0.3%
11 583.1 6.182 1.0%
12 608.8 1.643 0.2%
13 638.7 3.053 0.4%
14 676.1 6.914 1.0%
15 715.2 3.613 0.5%
16 702.4 9.935 1.4%
17 755.4 7.67 1.0%
18 779.9 5.414 0.6%
19 807.4 4.972 0.6%
20 812.6 6.416 0.7%
21 867.9 6.957 0.8%
22 891 5.333 0.5%
23 972.7 56.16 5.7%
24 943.3 5.783 0.6%
25 941.9 5.344 0.5%
26 1003 8.778 0.8%
27 1035 11.95 1.1%
28 1063 8.169 0.7%
29 1099 8.894 0.8%
30 1265 103.9 8.2%
31 1156 10.27 0.8%
32 1141 7.196 0.6%
33 1206 9.637 0.7%
34 1236 8.399 0.6%
35 1261 4.697 0.3%
36 1293 4.328 0.3%
37 1314 3.387 0.2%
38 1360 28.18 2.0%
39 1368 5.928 0.4%
40 1433 45.15 3.1%
41 1493 17.82 1.1%
42 1475 9.295 0.6%
43 1485 8.978 0.6%
44 1508 7.738 0.5%
45 1538 5.62 0.3%
46 1568 8.235 0.5%
47 1596 6.897 0.4%
48 1640 6.3 0.3%
49 1673 7.433 0.4%
50 1656 4.894 0.2%

Quality and confidence:
param error
b 0.17

Model:
Time ~= 295.3
+ b 27.76
µs

Reads = 23 + (0 * b)
Writes = 15 + (3 * b)

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: AcalaOracle IsUpdated (r:1 w:0)
Storage: AcalaOracle Values (r:1 w:0)
Storage: StakingPool StakingPoolLedger (r:1 w:0)
Storage: Tokens TotalIssuance (r:1 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: CdpEngine CollateralParams (r:1 w:0)
Storage: Tokens Accounts (r:6 w:6)
Storage: System Account (r:4 w:3)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)
Storage: AuctionManager TotalCollateralInAuction (r:1 w:0)
Storage: Dex TradingPairStatuses (r:3 w:0)
Storage: Dex LiquidityPool (r:3 w:2)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 408.6
µs

Reads = 31
Writes = 16

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 408.6
µs

Reads = 31
Writes = 16

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

Storage: EmergencyShutdown IsShutdown (r:1 w:0)
Storage: Loans Positions (r:1 w:1)
Storage: Prices LockedPrice (r:2 w:0)
Storage: CdpEngine DebitExchangeRate (r:1 w:0)
Storage: Tokens Accounts (r:2 w:2)
Storage: System Account (r:2 w:1)
Storage: CdpTreasury DebitPool (r:1 w:1)
Storage: Rewards SharesAndWithdrawnRewards (r:1 w:1)
Storage: Rewards PoolInfos (r:1 w:1)
Storage: Loans TotalPositions (r:1 w:1)

Median Slopes Analysis

-- Extrinsic Time --

Model:
Time ~= 160.5
µs

Reads = 13
Writes = 8

Min Squares Analysis

-- Extrinsic Time --

Model:
Time ~= 160.5
µs

Reads = 13
Writes = 8

…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_cdp_engine --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/
ferrell-code
ferrell-code previously approved these changes Dec 17, 2021
Copy link
Contributor

@ferrell-code ferrell-code left a comment

Choose a reason for hiding this comment

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

lgtm, nits below

modules/dex/src/lib.rs Outdated Show resolved Hide resolved
modules/dex/src/lib.rs Outdated Show resolved Hide resolved
@wangjj9219
Copy link
Member Author

@qwer951123 honzon.closeLoanHasDebitByDex changed, plz update front end and sdk

@wangjj9219 wangjj9219 merged commit fc0a1e0 into master Dec 18, 2021
@wangjj9219 wangjj9219 deleted the optimize-internal-swap branch December 18, 2021 14:55
syan095 pushed a commit that referenced this pull request Dec 19, 2021
…d-field

* origin/master:
  Cancel Scheduled Calls with Vote Greater than Original Call (#1701)
  optimize internal swap (#1704)
  Support eip-1559 (#1709)
  fix: update KBTC and KINT keys (#1710)
  Refund extra tip (#1706)
  Support LiquidCroadloan and ForeignAsset for TradingPair (#1703)
  Update README.md
  bug bounty (#1699)
  Update transaction-payment (#1682)
  rename create_network_contract (#1686)
  Bump @openzeppelin/contracts from 4.3.3 to 4.4.1 in /ts-tests (#1698)

# Conflicts:
#	modules/auction-manager/src/lib.rs
#	modules/cdp-engine/src/tests.rs
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