-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow the allocator to track the heap changes. #9291
Conversation
client/allocator/src/freeing_bump.rs
Outdated
} | ||
macro_rules! log { | ||
($level:tt, $( $args:expr ),+ ) => { | ||
log::$level!(target: "wasm-heap", $( $args ),+); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, this macro looks (at the call sites) a bit weird. Why don't we just remove it altogether, and stick to a regular logging as found in the rest of codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a patter that I use a lot in pallets, but I will respect the fact that this is the client realm and most logs are not like this, so will revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, my main preference for this is that I don't like repeating target: "..."
all over the place.
client/allocator/Cargo.toml
Outdated
@@ -26,5 +26,5 @@ std = [ | |||
"sp-std/std", | |||
"sp-core/std", | |||
"sp-wasm-interface/std", | |||
"log", | |||
"log/std", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"log/std", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh about this: now the allocator is even in client. Should this crate really have a separate "std" feature? I can just remove that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The std feature is not needed. We should remove it IMO
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with the caveat that I don't feel qualified to fully asses the performance implications.
bot merge |
Trying merge. |
This will greatly help with
try-runtime
'soffchain_worker
. I can now re-execute the last offchain worker's election code, as such, and get this nice report of heap usage:which shows the bumper being around 70mb, still far from the current 128mb.