gear icon indicating copy to clipboard operation
gear copied to clipboard

consider to charge for bump (re)allocations

Open gshep opened this issue 1 year ago • 0 comments

File Location(s)

No response

Proposal

while working on #3513 faced that decode_bytes benchmark returns different base weight from run to run:

/// The range of component `a` is `[0, 33554332]`.
fn decode_bytes(a: u32, ) -> Weight {
      // Proof Size summary in bytes:
      //  Measured:  `0`
      //  Estimated: `0`
      // Minimum execution time: 0_000 picoseconds.
      Weight::from_parts(0, 0)
	      // Standard Error: 0
	      .saturating_add(Weight::from_parts(160, 0).saturating_mul(a.into()))
}

Sometimes it is zero like the example shows sometimes it is about 6_000_000. Perhaps this is due new allocation by FreeingBumpAllocator and hence we should take such reallocations into account.

gshep avatar Mar 18 '24 15:03 gshep