MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _format_table

Function _format_table

python/benchmarks/benchmark_data_processing.py:93–112  ·  view source on GitHub ↗
(stats: list[BenchStats])

Source from the content-addressed store, hash-verified

91
92
93def _format_table(stats: list[BenchStats]) -> str:
94 header = (
95 "name".ljust(22)
96 + "rows".rjust(12)
97 + "mean_ms".rjust(12)
98 + "p95_ms".rjust(12)
99 + "rows/s".rjust(14)
100 + "MB/s".rjust(12)
101 )
102 lines = [header, "-" * len(header)]
103 for s in stats:
104 lines.append(
105 s.name.ljust(22)
106 + f"{s.rows:,}".rjust(12)
107 + f"{s.mean_ms:,.2f}".rjust(12)
108 + f"{s.p95_ms:,.2f}".rjust(12)
109 + _format_rate(s.rows_per_sec).rjust(14)
110 + f"{s.mb_per_sec:,.1f}".rjust(12)
111 )
112 return "\n".join(lines)
113
114
115def _compare_against_baseline(

Callers 1

run_benchmarksFunction · 0.85

Calls 2

_format_rateFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected