]> Sergey Matveev's repositories - public-inbox.git/commit
wwwlisting: avoid lazy loading JSON module
authorEric Wong <e@yhbt.net>
Thu, 19 Mar 2020 08:32:53 +0000 (03:32 -0500)
committerEric Wong <e@yhbt.net>
Fri, 20 Mar 2020 18:22:51 +0000 (18:22 +0000)
commit8fb8fc52420ef669c5b9c583d32647e9fbdffd88
treefd72fc5be02fd3e5bb901f2330626756534a5d89
parentc713cd419189cbe5cf72b6e60e846458985ffcdb
wwwlisting: avoid lazy loading JSON module

We already lazy-load WwwListing for the CGI script, and
hiding another layer of lazy-loading makes things difficult
to do WWW->preload.

We want long-lived processes to do all long-lived allocations up
front to avoid fragmentation in the allocator, but we'll still
support short-lived processes by lazy-loading individual modules
in the PublicInbox::* namespace.

Mixing up allocation lifetimes (e.g. doing immortal allocations
while a large amount of space is taken by short-lived objects)
will cause fragmentation in any allocator which favors large
contiguous regions for performance reasons.  This includes any
malloc implementation which relies on sbrk() for the primary
heap, including glibc malloc.
lib/PublicInbox/WwwListing.pm
t/www_listing.t