From e146ca6bb88dc8a70a7897dcfd07940e046f7e33 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Jan 2019 13:03:08 +0000 Subject: Use buffered stdio Our generation of HTML triggers many small write(2) syscalls which is inefficient. Time output on a horrible query against my git.git mirror shows significant performance improvement: QUERY_STRING='id=2b93bfac0f5bcabbf60f174f4e7bfa9e318e64d5&id2=d6da71a9d16b8cf27f9d8f90692d3625c849cbc8' PATH_INFO=/mirrors/git.git/diff export QUERY_STRING PATH_INFO time ./cgit >/dev/null Before: real 0m1.585s user 0m0.904s sys 0m0.658s After: real 0m0.750s user 0m0.666s sys 0m0.076s --- www/git.causal.agency/cgit/cgit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/git.causal.agency/cgit/cgit.c') diff --git a/www/git.causal.agency/cgit/cgit.c b/www/git.causal.agency/cgit/cgit.c index c4320f04..d8ea2212 100644 --- a/www/git.causal.agency/cgit/cgit.c +++ b/www/git.causal.agency/cgit/cgit.c @@ -674,7 +674,7 @@ static inline void authenticate_post(void) len = MAX_AUTHENTICATION_POST_BYTES; if ((len = read(STDIN_FILENO, buffer, len)) < 0) die_errno("Could not read POST from stdin"); - if (write(STDOUT_FILENO, buffer, len) < 0) + if (fwrite(buffer, 1, len, stdout) < len) die_errno("Could not write POST to stdout"); cgit_close_filter(ctx.cfg.auth_filter); exit(0); -- cgit 1.4.1 ;follow=1'>diff
path: root/doc/rfc/.gitignore (unfollow)
Commit message (Expand)Author
2021-09-21Use Z_FILTERED strategyJune McEnroe
2021-09-21Recalculate various lengths only as neededJune McEnroe
2021-09-21Rewrite pngo, add explicit optionsJune McEnroe
2021-09-16Fix /* **/ comment matchingJune McEnroe
2021-09-15Remove typer, add downgrade to READMEJune McEnroe
2021-09-15Set bot mode on downgradeJune McEnroe
2021-09-15Enter capsicum in downgradeJune McEnroe
2021-09-15Factor out common parts of downgrade messagesJune McEnroe
2021-09-14Add downgrade IRC botJune McEnroe
2021-09-14Sort by title if authors matchJune McEnroe
2021-09-13Swap-remove tags as they're foundJune McEnroe
2021-09-12Replace htagml regex with strncmpJune McEnroe
2021-09-11Also defer printing comment for lone close-parensJune McEnroe
2021-09-10Publish "git-comment"June McEnroe
2021-09-10Add git comment --pretty optionJune McEnroe
2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe
2021-09-08Up default min-repeat to 30 linesJune McEnroe
2021-09-08Handle dirty lines in git-commentJune McEnroe
2021-09-08Document and install git-commentJune McEnroe
2021-09-08Add repeat and all options to git-commentJune McEnroe
2021-09-08Add group threshold to git-commentJune McEnroe