For long-lived daemons, perform immortal allocations as early as possible to reduce the likelyhood of heap fragmentation due to mixed-lifetime allocations happening once the process is fully loaded and serving requests, since per-request allocations should all be short-lived.
On a side note, I'm wondering if WWW should just preload by default. I'm not sure if anybody uses public-inbox.cgi (or should be using it :P). It's not like we don't ship public-inbox-httpd; and any PSGI implementation could be used for smaller inboxes (or powerful-enough hardware). Eric Wong (6): www: update ->preload for newer modules wwwlisting: favor "use" over require wwwlisting: avoid lazy loading JSON module www: avoid `state' usage to perform allocations up-front daemon: do more immortal allocations up front viewdiff: favor `qr' to precompile regexps lib/PublicInbox/NNTPD.pm | 4 +++ lib/PublicInbox/SolverGit.pm | 13 +++++---- lib/PublicInbox/ViewDiff.pm | 53 +++++++++++++++++++---------------- lib/PublicInbox/WWW.pm | 29 ++++++++++++++----- lib/PublicInbox/WwwListing.pm | 30 +++++++++----------- t/www_listing.t | 4 +-- 6 files changed, 78 insertions(+), 55 deletions(-) -- unsubscribe: one-click, see List-Unsubscribe header archive: https://public-inbox.org/meta/
