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
repsint

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

callcallable

The function to be called

argsiterable

The positional arguments to be passed to call

Returns
dict
The dictionary contains the following key:value pairs: avgfloat

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

timefloat

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

cntint

The total count of calls to call(*args)