biogeme.profiling.benchmark module

class biogeme.profiling.benchmark.BenchmarkCaseResult(label, first_call_time, second_call_time, repeated_call_times=<factory>)[source]

Bases: object

Parameters:
  • label (str)

  • first_call_time (float)

  • second_call_time (float | None)

  • repeated_call_times (list[float])

first_call_time: float
label: str
property mean_repeated_time: float | None
repeated_call_times: list[float]
second_call_time: float | None
class biogeme.profiling.benchmark.BenchmarkSeriesResult(label, result, metadata=<factory>)[source]

Bases: object

Parameters:
label: str
metadata: dict[str, Any]
result: BenchmarkCaseResult
summary()[source]
Return type:

str

biogeme.profiling.benchmark.run_benchmark(label, function, *args, repeats=5, metadata=None, **kwargs)[source]

Run a simple benchmark with first-call, second-call, and repeated timings.

Return type:

BenchmarkSeriesResult

Parameters:
  • label (str)

  • function (Callable[[...], Any])

  • args (Any)

  • repeats (int)

  • metadata (dict[str, Any] | None)

  • kwargs (Any)