URL: <https://savannah.gnu.org/bugs/?68326>
Summary: grotty buffers entire output into memory for
unpaginated documents
Group: GNU roff
Submitter: None
Submitted: Fri 08 May 2026 06:47:40 AM UTC
Category: Driver grotty
Severity: 3 - Normal
Item Group: Rendering/Cosmetics
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 08 May 2026 06:47:40 AM UTC By: Anonymous
While the resolution to https://savannah.gnu.org/bugs/?68145 fixed end-to-end
render times, I am still observing a regression over groff 1.23 on the metric
of time-to-first-byte, i.e. how long you have to wait when issuing a man
command on a very long document before your pager starts rendering anything.
I determined that the root cause of this is the same as #68145, that following
the changes to the man macros, grotty is now buffering the entire document
into memory before displaying anything. While there is no longer any
allocation thrashing, this is still too long to wait for a man command.
I've attached a patch to periodically flush the head of the grotty line
buffer. I verified it produces byte-identical output on my pathologically
large manpage as well as continuing to pass all tests.
For the command: time ./result/bin/troff -Tascii -Wall -man
~/configuration.nix.5 | ./result/bin/grotty | head >/dev/null
1.23.0:
real 0m0.013s
user 0m0.010s
sys 0m0.012s
1.24.1:
real 0m53.468s
user 0m14.779s
sys 0m41.223s
master:
real 0m2.545s
user 0m3.077s
sys 0m0.171s
master + attached patch:
real 0m0.110s
user 0m0.130s
sys 0m0.017s
_______________________________________________________
File Attachments:
Name: unbuffer.patch Size: 4.4KiB
<https://file.savannah.gnu.org/file/unbuffer.patch?file_id=58598>
AGPL NOTICE
These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68326>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
