Uh oh!
There was an error while loading. Please reload this page.
perf(coverage): emit each HTML page's code table in one awk pass - #1100
Merged
Conversation
generate_file_html was 8.1s of a 9.5s report: a Bash loop classifying, looking up and echoing markup for each of 22,405 source lines, plus 15 `cat <<EOF` blocks per page -- 1935 forks for a 129-page report. The code table is one awk pass now, reading the hits block, the per-line test list and the source together, and the markup blocks go through a builtin read loop instead of cat. 9.5s to 4.5s, or 58.7s to 4.5s counting the escaping fix in #1097. Output is byte-identical on a fixed corpus, verified both with no hits and with real hits and tooltips -- the no-hits corpus never renders a badge, so it would not have caught a mistake in that path. The multiplication sign in the badge is passed as an awk variable rather than written as \xc3\x97: `\x` is not POSIX awk, and it should not matter that the three awks I tested happen to accept it. Closes#1098
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #1098
After the escaping fix,
generate_file_htmlwas 8.1 s of a 9.5 s report: aBash loop classifying, looking up and echoing markup for each of 22,405 source
lines, plus 15
cat <<EOFblocks per page — 1935 forks for a 129-page report.💡 Changes
cat×is passed as an awk variable rather than\xc3\x97, since\xis not POSIX awk