firestorm
firestorm copied to clipboard
Procedure macro
trafficstars
I think it will be more idiomatic to mark the profiling function like this
#[profile_fn]
fn fn_name<T>(param: T) {
// If a function is complex, profile a section.
#[profile_section]
{
// Optional: manually drop.
// Section automatically drops when going out of scope.
drop(inner);
}
}
This API looks like the profiling crate, and it looks more ergonomic to me.
I agree that appears less verbose, and is especially nice in that the function signature need not be duplicated. IDE support for macros can be hit or miss though. Also, sometimes compile times can be negatively affected. So, it's not a clear win. We could provide it as an option though.