pub struct ConvexTimingScope { /* private fields */ }Expand description
RAII installation of a convex-path timing sink: ConvexTimingScope::open
makes stats the active sink, and dropping the returned guard restores
whatever was installed before it.
A guard rather than a with(…, closure) wrapper because the driver that
opens the scope is a long function with several early returns, and each of
those must still restore the previous sink.
The tasks inside stats carry their own enabled flag, so a solve that was
not asked for timing statistics pays one thread-local read per
time_linear_system call and no clock syscalls at all.
Thread-local means exactly that: work a scope-holding thread hands to
worker threads (pounce_convex::solve_qp_batch_parallel) is not charged,
because those threads have no scope. The convex CLI driver — the only
caller that opens one — solves on the thread that opened it.