goldsluice.profile

Time an algorithm on both backends: print(compare("peak", traces, glitch_samples=10, ...)).

Functions

compare(name, traces, *[, repeat, python_events])

Best-of-repeat wall time of the Rust kernel over all traces, and of the Python mirror over the first python_events (it is slow), scaled up.

Classes

Timing(name, n_events, n_samples, rust_s, ...)

class goldsluice.profile.Timing(name: str, n_events: int, n_samples: int, rust_s: float, python_s: float, python_events: int)[source]

Bases: object

Parameters:
name: str
n_events: int
n_samples: int
rust_s: float
python_s: float
python_events: int
property speedup
goldsluice.profile.compare(name, traces, *, repeat=5, python_events=200, **params)[source]

Best-of-repeat wall time of the Rust kernel over all traces, and of the Python mirror over the first python_events (it is slow), scaled up. The Rust time includes the call, the contiguity check and the output arrays, not the first-call import.