Problem
After #1098 the HTML report is 4.5s for 128 files. The largest single item left
is the functions table in generate_file_html: for every function it walks
fn_start..fn_end in Bash, calling is_executable_line and reading the hit
array per line.
That is a second full classification pass over every source file — roughly
22,000 calls for this repo, about 1.5s — duplicating work the row emitter
already does in awk.
Measured over 128 files / 22,442 lines:
| 128 pages |
|---|
generate_file_html total | ~4000 ms |
html_code_rows (awk) | 551 ms |
extract_functions (awk) | 517 ms |
get_all_line_tests | 485 ms |
| reading lines into the array | 236 ms |
| the per-function rescan | ~1500 ms |
Proposal
Emit name|start|end|executable|hit from one awk pass — the same shape the
LCOV FN section already computes — so the Bash side only formats rows. That
also removes the separate extract_functions call, since the spans come from
the same pass.
report_html itself still forks three times per page ($(pwd),
$(get_cached_stats …), $(path_to_filename …)), worth taking at the same
time.
Verification
Byte-identical HTML against a fixed corpus, with hits and tooltips, as in
#1097 and #1098.
Problem
After #1098 the HTML report is 4.5s for 128 files. The largest single item left
is the functions table in
generate_file_html: for every function it walksfn_start..fn_endin Bash, callingis_executable_lineand reading the hitarray per line.
That is a second full classification pass over every source file — roughly
22,000 calls for this repo, about 1.5s — duplicating work the row emitter
already does in awk.
Measured over 128 files / 22,442 lines:
generate_file_htmltotalhtml_code_rows(awk)extract_functions(awk)get_all_line_testsProposal
Emit
name|start|end|executable|hitfrom one awk pass — the same shape theLCOV
FNsection already computes — so the Bash side only formats rows. Thatalso removes the separate
extract_functionscall, since the spans come fromthe same pass.
report_htmlitself still forks three times per page ($(pwd),$(get_cached_stats …),$(path_to_filename …)), worth taking at the sametime.
Verification
Byte-identical HTML against a fixed corpus, with hits and tooltips, as in
#1097 and #1098.