-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re_datastore: puffin probes! #942
Conversation
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.
Nice with scopes!
What does the puffin flamegraph of nyud look like now?
In the other crates we only include puffin on native, because it adds quite a bit of wasm for very little gain (timers only have 1ms accuracy on web).
So all other crates do this:
/// Profiling macro for puffin
#[doc(hidden)]
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}
/// Profiling macro for puffin
#[doc(hidden)]
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
and then use crate::profile_function
etc.
I think might have gotten a bit overboard with the number of profiling scopes. This is the "plot" demo: Each puffin call has an overhead of around 100ns-200ns, so that's a per-frame overhead here of ~3-6ms, which is too much. We should try to keep the number of total profile scopes below 10k. …or, perhaps There is also some levels in the profiling missing - I don't immediately understand what part of (NOTE: this overhead is only when a profiler is actually connected. When profiling is off, the per-call overhead drops from ~100ns to ~1ns) EDIT: |
This is pretty much the only thing left before we can close #443 (despite the issue telling otherwise 😬).