mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +00:00
Refactor weight constants, Update to remove redundant overhead (#5884)
* Move weight values to `frame_support` * more accurate comment * update balances * vesting * update util * Add weight to time constants * use weight constants in weights * update tests
This commit is contained in:
@@ -194,11 +194,11 @@ decl_module! {
|
||||
/// - Reads: Vesting Storage, Balances Locks, [Sender Account]
|
||||
/// - Writes: Vesting Storage, Balances Locks, [Sender Account]
|
||||
/// - Benchmark:
|
||||
/// - Unlocked: 56.1 + .098 * l µs (min square analysis)
|
||||
/// - Locked: 54.37 + .254 * l µs (min square analysis)
|
||||
/// - Using 60 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// - Unlocked: 48.76 + .048 * l µs (min square analysis)
|
||||
/// - Locked: 44.43 + .284 * l µs (min square analysis)
|
||||
/// - Using 50 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// # </weight>
|
||||
#[weight = 60_000_000 + T::DbWeight::get().reads_writes(2, 2)]
|
||||
#[weight = 50_000_000 + T::DbWeight::get().reads_writes(2, 2)]
|
||||
fn vest(origin) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
Self::update_lock(who)
|
||||
@@ -219,11 +219,11 @@ decl_module! {
|
||||
/// - Reads: Vesting Storage, Balances Locks, Target Account
|
||||
/// - Writes: Vesting Storage, Balances Locks, Target Account
|
||||
/// - Benchmark:
|
||||
/// - Unlocked: 58.09 + .104 * l µs (min square analysis)
|
||||
/// - Locked: 55.35 + .255 * l µs (min square analysis)
|
||||
/// - Using 60 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// - Unlocked: 44.3 + .294 * l µs (min square analysis)
|
||||
/// - Locked: 48.16 + .103 * l µs (min square analysis)
|
||||
/// - Using 50 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// # </weight>
|
||||
#[weight = 60_000_000 + T::DbWeight::get().reads_writes(3, 3)]
|
||||
#[weight = 50_000_000 + T::DbWeight::get().reads_writes(3, 3)]
|
||||
fn vest_other(origin, target: <T::Lookup as StaticLookup>::Source) -> DispatchResult {
|
||||
ensure_signed(origin)?;
|
||||
Self::update_lock(T::Lookup::lookup(target)?)
|
||||
@@ -244,10 +244,10 @@ decl_module! {
|
||||
/// - DbWeight: 3 Reads, 3 Writes
|
||||
/// - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]
|
||||
/// - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]
|
||||
/// - Benchmark: 111.4 + .345 * l µs (min square analysis)
|
||||
/// - Using 115 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// - Benchmark: 100.3 + .365 * l µs (min square analysis)
|
||||
/// - Using 100 µs fixed. Assuming less than 50 locks on any user, else we may want factor in number of locks.
|
||||
/// # </weight>
|
||||
#[weight = 115_000_000 + T::DbWeight::get().reads_writes(3, 3)]
|
||||
#[weight = 100_000_000 + T::DbWeight::get().reads_writes(3, 3)]
|
||||
pub fn vested_transfer(
|
||||
origin,
|
||||
target: <T::Lookup as StaticLookup>::Source,
|
||||
|
||||
Reference in New Issue
Block a user