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.
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.
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.
FWIW, my main preference for this is that I don't like repeating target: "..." all over the place.
client/allocator/Cargo.toml
Outdated
| "sp-core/std", | ||
| "sp-wasm-interface/std", | ||
| "log", | ||
| "log/std", |
There was a problem hiding this comment.
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.
The std feature is not needed. We should remove it IMO
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
emostov
left a comment
There was a problem hiding this comment.
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.