summaryrefslogtreecommitdiff
path: root/contrib/perf/02-cgit-output-buffering.patch
AgeCommit message (Collapse)AuthorFilesLines
3 dayscontrib/perf: strip ESI changes out of the buffering patchPer Buer1-142/+5
02-cgit-output-buffering.patch was cut from a working tree that already carried the ESI work, so it also contained the enable-esi config hook, cache_key(), the repolink and cgit_fileurl fragment hunks and the memrchr fix. That contradicted its README and made it fail to apply on any tree that already had ESI, which is every tree in this repository. Regenerate it with only the output buffering change: the html.c buffer itself and the flushes in cache.c, filter.c, cgit.c and ui-shared.c. Verified to apply cleanly both to stock cgit and on top of the ESI commits here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3 dayscontrib/perf: patches for ref decoration and output bufferingPer Buer1-0/+307
Two independent performance patches found while measuring the ESI split, both of which help whether or not a cache sits in front of cgit. 01-git-peel-decoration.patch applies to the git submodule. git's add_ref_decoration() calls parse_object() on every annotated tag to follow it to its commit, inflating all of them, even though the ref backend already hands the callback a peeled object id when packed-refs has one. Using that takes commit and log pages on git.git from about 6 ms to about 2 ms. Output is byte-identical and git's own t4202-log, t3200-branch and t6300-for-each-ref pass. 02-cgit-output-buffering.patch applies to cgit. html_raw() did one write(2) per call: a 1.7 MB diff took 99151 writes averaging 18 bytes. A 64 KB buffer takes that to 27. The buffer has to be flushed wherever fd 1 is redirected or handed to another writer, which is the cache slot, exec filters, and the end of the HTTP headers, because git's archive code writes snapshots and clone data straight to fd 1. Kept as patches rather than applied because the first belongs upstream in git, and the second touches enough of cgit's output path to be worth landing on its own terms. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>