From patchwork Mon Apr 15 15:27:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 2476 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0685627BBEB; Mon, 15 Apr 2024 16:29:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5343527BBEA for ; Mon, 15 Apr 2024 16:29:39 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwOGW-000474-Qj; Mon, 15 Apr 2024 11:29:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwOGQ-00045u-D9 for guix-patches@gnu.org; Mon, 15 Apr 2024 11:28:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwOGL-0008I8-O3; Mon, 15 Apr 2024 11:28:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwOGV-0006f8-LH; Mon, 15 Apr 2024 11:29:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70398] [PATCH 0/5] Reduce the size of gnu/packages/*.go files Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 15 Apr 2024 15:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70398@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.171319490425275 (code B ref -1); Mon, 15 Apr 2024 15:29:03 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2024 15:28:24 +0000 Received: from localhost ([127.0.0.1]:37820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwOFm-0006Yn-JW for submit@debbugs.gnu.org; Mon, 15 Apr 2024 11:28:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwOFe-0006WP-H2 for submit@debbugs.gnu.org; Mon, 15 Apr 2024 11:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwOFJ-0003y2-Rq for guix-patches@gnu.org; Mon, 15 Apr 2024 11:27:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwOFJ-0008D1-Im; Mon, 15 Apr 2024 11:27:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=1L4kkuE/4SdugaIqHE3X4BsGqWFLTdC9ewEbqqXRPJg=; b=ODHFKCdZg1ohFA p0jcq9xpL7u6M3md3IOtn5mDShABJmdfebQOi6acC0QJtqhSuPgO3c3qT5Pgs9IWi/ln6v2qHmRz8 o3cVdxV5clH8psZ7zwWABR/MnRGp+r0i5JUri48nnzleuG4RRZA3q3nsvaY5jxJ/zyErSMmc5o+HZ iVDUdBWl4VFQxpEfdlBnFOkI6cN8HD2kCJqELCWu01URo+FckCROYhDeg72exvKVHvd4Mf9lFGm51 BS59qFdPEfs/DlppgtEAoGTHyDJAAmhFeiIR2wjczIvloEWxEZ7HbEl1GZ6mr7K+UKETv6Aj20K1F oUM4ill+pgAumYFMxK1w==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Apr 2024 17:27:36 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello! As a followup to , I started looking into the size of Guix itself, and in particular that of gnu/packages/*.go files. What follows is a bunch of tricks to reduce code bloat, achieving ~14% reduction in the size of .go files (~18% if we look at gnu/packages alone). About 60% of those files are in the 64–128 KiB range. Since ELF sections are currently 64 KiB-aligned (see ‘*lcm-page-size*’ in Guile), we would save space by ensuring these are sparse files. To do that, we’ll need to detect holes when restoring nars and/or to change the nar format to preserve holes, while also ensuring that when the daemon copies files around, it also preserves holes. Work for later! Thoughts? Ludo’. Ludovic Courtès (5): records: Do not inline throws for ABI mismatches. packages: Reduce bloat induced by ‘sanitize-inputs’. records: Do not inline the constructor. packages: ‘define-public’ replacement calls ‘module-export!’ directly. packages: Reduce code bloat due to list allocation in input fields. guix/packages.scm | 53 +++++++++++++++++++++++++++++++++++-------- guix/records.scm | 58 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 83 insertions(+), 28 deletions(-) base-commit: cd45294d576975a3bff2f755764a3f46f09ea6f9