From: "Ludovic Courtès" <ludo@gnu.org>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 70398@debbugs.gnu.org, Josselin Poiret <dev@jpoiret.xyz>,
Mathieu Othacehe <othacehe@gnu.org>,
Tobias Geerinckx-Rice <me@tobias.gr>,
Ricardo Wurmus <rekado@elephly.net>,
Christopher Baines <guix@cbaines.net>
Subject: [bug#70398] [PATCH 5/5] packages: Reduce code bloat due to list allocation in input fields.
Date: Mon, 15 Apr 2024 22:31:20 +0200 [thread overview]
Message-ID: <877cgyz7tz.fsf@gnu.org> (raw)
In-Reply-To: <87zftuik7b.fsf@gmail.com> (Simon Tournier's message of "Mon, 15 Apr 2024 19:56:08 +0200")
Simon Tournier <zimon.toutoune@gmail.com> skribis:
> On lun., 15 avril 2024 at 17:37, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> + ((_ (list args ...))
>> + ;; As of 3.0.9, (list ...) is open-coded, which can lead to a long list
>> + ;; of instructions. To reduce code bloat in package modules where input
>> + ;; fields may create such lists, move list allocation to the callee.
>> + (add-input-labels args ...))
>
> I am not sure to understand: « (list ...) is open-coded, which can lead
> to a long list of instructions. ».
This:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,c (lambda () (list 1 2 3 4))
[...]
8 (allocate-words/immediate 0 2)
9 (scm-set!/immediate 0 0 2)
10 (scm-set!/immediate 0 1 1)
11 (allocate-words/immediate 2 2)
12 (scm-set!/immediate 2 0 3)
13 (scm-set!/immediate 2 1 0)
14 (allocate-words/immediate 3 2)
15 (scm-set!/immediate 3 0 4)
16 (scm-set!/immediate 3 1 2)
17 (allocate-words/immediate 4 2)
18 (scm-set!/immediate 4 0 5)
19 (scm-set!/immediate 4 1 3)
--8<---------------cut here---------------end--------------->8---
> Well, irrelevant for .go size but why not something like:
>
> ((_ (list args . rest))
> (apply add-inputs-labels (append args rest)))
That’s more code and I’m really trying hard to minimize generated code.
:-)
Ludo’.
next prev parent reply other threads:[~2024-04-15 20:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 15:27 [bug#70398] [PATCH 0/5] Reduce the size of gnu/packages/*.go files Ludovic Courtès
2024-04-15 15:37 ` [bug#70398] [PATCH 1/5] records: Do not inline throws for ABI mismatches Ludovic Courtès
2024-04-15 15:37 ` [bug#70398] [PATCH 2/5] packages: Reduce bloat induced by ‘sanitize-inputs’ Ludovic Courtès
2024-04-15 15:37 ` [bug#70398] [PATCH 3/5] records: Do not inline the constructor Ludovic Courtès
2024-04-15 15:37 ` [bug#70398] [PATCH 4/5] packages: ‘define-public’ replacement calls ‘module-export!’ directly Ludovic Courtès
2024-04-15 15:37 ` [bug#70398] [PATCH 5/5] packages: Reduce code bloat due to list allocation in input fields Ludovic Courtès
2024-04-15 17:56 ` Simon Tournier
2024-04-15 20:31 ` Ludovic Courtès [this message]
2024-04-22 0:15 ` Simon Tournier
2024-04-15 16:10 ` [bug#70398] [PATCH 0/5] Reduce the size of gnu/packages/*.go files Ludovic Courtès
2024-04-15 18:49 ` Simon Tournier
2024-04-15 16:24 ` Ludovic Courtès
2024-04-15 18:06 ` Simon Tournier
2024-05-04 17:17 ` bug#70398: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cgyz7tz.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=70398@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=rekado@elephly.net \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).