From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3B7311F619 for ; Thu, 19 Mar 2020 08:32:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 0/6] daemon: reduce fragmentation via preload Date: Thu, 19 Mar 2020 03:32:50 -0500 Message-Id: <20200319083256.15593-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-)