bundle.perf_report.report.base¶
Shared utilities for performance report generation (cProfile and Tracy).
Attributes¶
Functions¶
|
Format a seconds value into a human-readable (value, unit) pair. |
|
Format a nanosecond value into a human-readable (value, unit) pair. |
|
|
|
|
|
Return the best (unit, multiplier_from_seconds) for a list of second values. |
|
Return the best (unit, multiplier_from_ns) for a list of nanosecond values. |
|
Truncate a file path to its last |
|
Extract bundle-relative path: .../bundle/core/tracer.py -> core/tracer.py |
|
|
|
|
|
|
|
|
|
Create a dark-themed horizontal bar chart canvas. |
|
Draw baseline comparison bars and add the legend. |
|
Apply bar-value labels, axis formatting, and save the plot. |
|
Build a platform info summary table from HDF5 metadata. |
|
Find the most recent version in HDF5 that isn't the current one and has this platform. |
|
Generic report generation pipeline shared by cProfile and Tracy backends. |
Module Contents¶
- bundle.perf_report.report.base.LOGGER¶
- bundle.perf_report.report.base.MAX_PARALLEL_ASYNC = 20¶
- bundle.perf_report.report.base.TOP_N_PLOT = 10¶
- bundle.perf_report.report.base.TOP_N_TABLE = 30¶
- bundle.perf_report.report.base.TIME_THRESHOLDS = [(1.0, 's', 1.0), (0.001, 'ms', 1000.0), (1e-06, 'μs', 1000000.0), (0.0, 'ns', 1000000000.0)]¶
- bundle.perf_report.report.base.CLR_CURRENT = '#87CEEB'¶
- bundle.perf_report.report.base.CLR_BASELINE = '#FF8C66'¶
- bundle.perf_report.report.base.format_time_seconds(seconds: float) tuple[str, str]¶
Format a seconds value into a human-readable (value, unit) pair.
- bundle.perf_report.report.base.format_time_ns(nanoseconds: int | float) tuple[str, str]¶
Format a nanosecond value into a human-readable (value, unit) pair.
- bundle.perf_report.report.base.best_unit_for_values_seconds(times_seconds: list[float]) tuple[str, float]¶
Return the best (unit, multiplier_from_seconds) for a list of second values.
- bundle.perf_report.report.base.best_unit_for_values_ns(times_ns: list[int | float]) tuple[str, float]¶
Return the best (unit, multiplier_from_ns) for a list of nanosecond values.
- bundle.perf_report.report.base.shorten_path(file_path: str, max_parts: int = 2) str¶
Truncate a file path to its last
max_partssegments.
- bundle.perf_report.report.base.normalize_src_path(src_file: str) str¶
Extract bundle-relative path: …/bundle/core/tracer.py -> core/tracer.py
- bundle.perf_report.report.base.setup_plot(n_bars: int, has_baseline: bool) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes, numpy.ndarray]¶
Create a dark-themed horizontal bar chart canvas.
- bundle.perf_report.report.base.draw_baseline_bars(ax: matplotlib.pyplot.Axes, y_pos: numpy.ndarray, baseline_times: list[float], bar_height: float)¶
Draw baseline comparison bars and add the legend.
- bundle.perf_report.report.base.finalize_plot(fig: matplotlib.pyplot.Figure, ax: matplotlib.pyplot.Axes, bars: Any, max_val: float, xlabel: str, plot_path: pathlib.Path) pathlib.Path¶
Apply bar-value labels, axis formatting, and save the plot.
- bundle.perf_report.report.base.build_platform_section(meta: dict) bundle.latex.Section¶
Build a platform info summary table from HDF5 metadata.
- bundle.perf_report.report.base.find_baseline_version(storage: Any, current_version: str, platform_id: str) str | None¶
Find the most recent version in HDF5 that isn’t the current one and has this platform.
- async bundle.perf_report.report.base.generate_report(input_path: pathlib.Path, output_path: pathlib.Path, h5_path: pathlib.Path | None, *, extractor_cls: Any, storage_cls: Any, generate_plot_fn: Callable, build_section_fn: Callable, build_func_map_fn: Callable, file_type_label: str)¶
Generic report generation pipeline shared by cProfile and Tracy backends.