Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Time the other filters at two lengths as well
The avatar checks held a 40000 byte address to half a second, twenty
times tighter than the readme budget that already failed on a slow
host, and in stub mode nearly all of that time went on the fake digest.
Link-commits and link-trailers had no check on a long input at all. The
readme checks' method moves into the harness so all four share it.
A single timing of each length let a busy host that took the CPU away
during the longer one make a linear pass look quadratic. The lengths
now take turns and the fastest timing of each counts, since a busy host
can slow one timing but rarely all five. A ratio under six ends the
turns at once, so only one near the bound of ten waits for all five.
Diffstat (limited to 'tests/extensions/test-link-commits.lua')
| -rw-r--r-- | tests/extensions/test-link-commits.lua | 7 |
1 file changed, 7 insertions, 0 deletions
diff --git a/tests/extensions/test-link-commits.lua b/tests/extensions/test-link-commits.lua index fa3a040..dca16d4 100644 --- a/tests/extensions/test-link-commits.lua +++ b/tests/extensions/test-link-commits.lua @@ -126,4 +126,11 @@ h.equals("the shipped examples link what they describe", out, "<a href='https://gitlab.example.com/my/repo/-/merge_requests/42'>!42</a> and " .. "<a href='https://www.rfc-editor.org/rfc/rfc9110'>RFC 9110</a>") +-- A message near cgit's size limit with a match every few bytes still has +-- to come out in linear time. +h.load_with(script, { { "-- { pattern = \"#(%d+)\"", "{ pattern = \"#(%d+)\"" } }) +h.stays_linear("a long message full of matches is linked in linear time", function(text) + return (render(text)) +end, function(count) return string.rep("deadbeef #1 ", count) end, 10000) + h.finish() |
