GNU bug report logs

#50349 [PATCH] packages: Add 'define-package' syntax.

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #47 received at 50349@debbugs.gnu.org (full text, mbox, reply):

Received: (at 50349) by debbugs.gnu.org; 4 Sep 2021 18:53:10 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 14:53:10 2021
Received: from localhost ([127.0.0.1]:48582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1mMams-0004dm-9a
	for submit@debbugs.gnu.org; Sat, 04 Sep 2021 14:53:10 -0400
Received: from out1.migadu.com ([91.121.223.63]:53231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@mgsn.dev>) id 1mMamp-0004dd-E5
 for 50349@debbugs.gnu.org; Sat, 04 Sep 2021 14:53:09 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1630781585;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=k33hJIsXchHXxh7V16A+NbMCP2cFOVvuMlEVBnfk5TE=;
 b=T58MxaOS4VKKqC4R11fGh/iV2Q2+MzV0NF6mfdmZ29NatRGJAziqkxvVaITh/RIpAy7cvo
 bxaIdg3skyc4iqxibjrlWaUfEOd+Au3d41zITYPWFe+rSn4PTxrrjjpIDqWgUO/E68ibki
 paBADPny7KD7IQyd6NODfg6EbjcrHO0=
From: Sarah Morgensen <iskarian@mgsn.dev>
To: Taylan Kammer <taylan.kammer@gmail.com>
Subject: Re: bug#50349: [PATCH] packages: Add 'define-package' syntax.
References: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev>
 <757b7543b931335c3725264edfbc79c012aa10fc.camel@telenet.be>
 <87y28caazy.fsf@nckx> <95c92fc5-1fcf-b347-370e-d1943f22c2c3@gmail.com>
 <87bl58wfk7.fsf@nckx> <a93161dd-4425-f722-fa43-273ff9561916@gmail.com>
Date: Sat, 04 Sep 2021 11:53:03 -0700
In-Reply-To: <a93161dd-4425-f722-fa43-273ff9561916@gmail.com> (Taylan Kammer's
 message of "Sat, 4 Sep 2021 19:23:29 +0200 (1 hour,
 11 minutes ago)")
Message-ID: <86v93gjhps.fsf@mgsn.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@mgsn.dev
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50349
Cc: Maxime Devos <maximedevos@telenet.be>, Tobias Geerinckx-Rice <me@tobias.gr>,
 50349@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.7 (-)
Hi Taylan,

Taylan Kammer <taylan.kammer@gmail.com> writes:

> On 04.09.2021 16:44, Tobias Geerinckx-Rice wrote:
>> Taylan Kammer 写道:
>>> To me the most obvious thing to do seems
>>>
>>>   (define-package foo ...)  ;no explicit name needed
>>>
>>> to bind the variable 'foo' and use symbol->string for the name of the
>>> package, with the possibility to override the name like
>>>
>>>   (define-package foo (name "foobar") ...)
>>>
>>> which would bind the variable 'foo' to a package named "foobar".
>> 
>> Right, that's what I meant, and it's how I read bug #15284, and it looks remarkably like the form I use in my personal channels (and I'm sure I'm not the first! :-).
>> 
>> You're much better at the language/implementation side of things than I am, Taylan.  Would this negatively affect performance (including ‘guix pull’ compilation)?
>> 
>> Kind regards,
>> 
>> T G-R

I agree; if we added that magic, that's definitely how it should be.

>
> I'm flattered, but don't really know the answer, so I decided to attempt
> some sort of benchmark. :-P
>
> test1.scm uses the syntax-case macro, test2.scm just define-public.
>
> I don't actually import the Guix modules, so the (package ...) form isn't
> macro-expanded, regardless of whether it's used directly or results from
> expanding define-package.
>
> This way, the impact of define-package should dominate the time difference.
>
> The results are... interesting.  I started out with 256 definitions in the
> files, and the define-package one would take about 4.2s to compile while
> the regular one about 3.9s.  There was some jitter in the results though
> after running it several times so I thought, let's increase the number of
> packages to reduce noise.
>
> With 512 packages, the one using regular define-public takes a whole
> minute to compile, whereas the define-package one just ~14 seconds!
>
> So no idea what's going on there, and how the use of this macro in the
> actual (gnu packages ...) modules would affect performance. :-)

Thanks for running some benchmarks. Were both those latter runs with a
warm cache?

If so, is it possible that due to a compilation optimization, many of
the global symbol lookups only happen once with the define-package
macro?

If you were really interested, I suppose you could test with compilation
optimization off, but I'd be more interested in the performance impact
with (guix packages) imported.

--
Sarah




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 16:32:37 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.