You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I find myself wishing there was a way to only instrument a piece of code if some condition is met, to reduce overhead:
fndo_stuff(n:usize){
puffin::profile_scope_if!(10_000 < n, "processing lots of data");for i in0..n {
…
}}
If do_stuff is called once with a big n, we get a profile scope.
If do_stuff is called a million times with a small n, we don't pay the overhead of the profiling.
The text was updated successfully, but these errors were encountered:
Sometimes I find myself wishing there was a way to only instrument a piece of code if some condition is met, to reduce overhead:
If
do_stuff
is called once with a bign
, we get a profile scope.If
do_stuff
is called a million times with a smalln
, we don't pay the overhead of the profiling.The text was updated successfully, but these errors were encountered: