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 8273E1F461 for ; Thu, 27 Jun 2019 22:51:48 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 0/4] www|nntp: optimize uses of Email::Simple Date: Thu, 27 Jun 2019 22:51:44 +0000 Message-Id: <20190627225148.9657-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can rely on the documented behavior of Email::Simple->new modifying its string buffer in-place to save us the trouble of calling ->body (or ->body_set('') to clobber the buffer). This yields significant memory use improvements in avoiding full message body copies in the WWW mbox code. Unfortunately, NNTP messages with LF-only line-endings won't benefit, since the protocol requires CRLF endings and the s/// operations get expensive. Memory bloat from giant emails and Email::MIME will require more work :< Eric Wong (4): nntp: rework and simplify art_lookup response mbox: use Email::Simple->new to do in-place modifications mbox: split header and body processing nntp: reduce syscalls for ARTICLE and BODY lib/PublicInbox/Mbox.pm | 73 +++++++++++++++++++++-------------------- lib/PublicInbox/NNTP.pm | 59 ++++++++++++++++----------------- 2 files changed, 67 insertions(+), 65 deletions(-) -- EW