Subject: [bug#70398] [PATCH 0/5] Reduce the size of gnu/packages/*.go files

From: Simon Tournier <[email-masked]>
Date: Mon, 15 Apr 2024 20:06:15 +0200

Hi,

On lun., 15 avril 2024 at 17:27, Ludovic Courtès <[email-masked]> wrote:

> 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).

If have not checked that the reduction would be of ~18%.  From my
understanding, the patch set LGTM; modulo an unrelated comment about
ellipsis and potential quadratic penalty on performances.

> 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!

Since [1], I think that compiling a generic Guile record for <package>
is touching the limit of DSL. :-) Other said, I think the binary
(compiled) representation of records <package> should be specific and
thus optimized.  Work for after later. ;-)

Cheers,
simon

1: How many bytes do we add (closure of guix) when adding one new package?
Simon Tournier <[email-masked]>
Thu, 25 May 2023 20:24:30 +0200
id:[email-masked]
https://lists.gnu.org/archive/html/guix-devel/2023-05
https://yhetil.org/guix/[email-masked]