From 62786f9a509a06ac031c066837d7a2285469677b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 8 Aug 2026 12:49:54 -1000 Subject: Emit generated runs in batches, not a write each --- source/html.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/html.h') diff --git a/source/html.h b/source/html.h index fa4de77..7572623 100644 --- a/source/html.h +++ b/source/html.h @@ -6,6 +6,13 @@ extern void html_raw(const char *txt, size_t size); extern void html(const char *txt); +/* How much of a generated run to build before handing it to html_raw. Batching + * is what removes the write per line, and html_raw already gathers what it is + * given into one buffer, so nothing is gained by growing past this. A run built + * whole would instead be sized by the file it was generated from, which the + * blob limits do not bound. */ +#define HTML_BATCH (64 * 1024) + __attribute__((format (printf,1,2))) extern void htmlf(const char *format,...); -- cgit v2.8.0