MCPcopy Create free account
hub / github.com/docling-project/docling-parse / write_static_timings_csv

Function write_static_timings_csv

perf/run_analysis.py:201–218  ·  view source on GitHub ↗

Write CSV with decode_page timing keys only, one row per page.

(out_path: Path, pages: List[PageTimings])

Source from the content-addressed store, hash-verified

199
200
201def write_static_timings_csv(out_path: Path, pages: List[PageTimings]) -> None:
202 """Write CSV with decode_page timing keys only, one row per page."""
203 ensure_parent(out_path)
204
205 # Get decode_page keys in order (excludes the global decode_page timer)
206 decode_page_keys = get_decode_page_timing_keys()
207
208 header = ["filename", "page_number", "elapsed_original_sec", *decode_page_keys]
209
210 with out_path.open("w", newline="") as f:
211 w = csv.writer(f)
212 w.writerow(header)
213 for p in pages:
214 row = [p.filename, p.page_number, f"{p.elapsed_original:.9f}"]
215 for k in decode_page_keys:
216 v = p.timings.get(k, 0.0)
217 row.append(f"{v:.9f}" if v else "")
218 w.writerow(row)
219
220
221def print_top_summary(pages: List[PageTimings]) -> None:

Callers 1

mainFunction · 0.85

Calls 3

ensure_parentFunction · 0.85
appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected