Performance Interface to numpy C-API

fastmat.core.cmath

fastmat.core.cmath.profileCall()

Measure the runtime of a function call with arguments by averaging the cumulated runtime of multiple calls.

To avoid unpacking arguments each time the function is called calls with one or two arguments get unpacked before the measurement, thus excluding argument unpacking in this case effectively.

Parameters:
reps : int

The number of repetitions of call() in one runtime measurement.

call : callable

The function to be called

args : iterable

The positional arguments to be passed to call

Returns:
dict
The dictionary contains the following key:value pairs: avg : float

The average runtime of a single call to call(*args)

time : float

The accumulated runtime of reps calls to call(*args)

cnt : int

The total count of calls to call(*args)