core.benchmark ============== .. py:module:: core.benchmark Classes ------- .. autoapisummary:: core.benchmark.Benchmark core.benchmark.BenchmarkResult Module Contents --------------- .. py:class:: Benchmark .. py:method:: compare() Prints a comparison table of all stored results. .. py:method:: measure(name: str, iterations: int = 10, warmup: int = 2) A context manager or decorator to measure a block of code. Usage as Context Manager: with benchmark.measure("My Test", iterations=50): do_something() .. py:attribute:: results :type: Dict[str, BenchmarkResult] .. py:class:: BenchmarkResult .. py:property:: average .. py:property:: best .. py:attribute:: iterations :type: int .. py:attribute:: name :type: str .. py:property:: stdev Standard Deviation helps you see how consistent the run was. .. py:attribute:: times :type: List[float] :value: [] .. py:property:: total .. py:property:: worst