Skip to main content

ConvexTimingScope

Struct ConvexTimingScope 

Source
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.

Implementations§

Trait Implementations§

Source§

impl Drop for ConvexTimingScope

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.