GNU bug report logs

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

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

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

Received: (at submit) by debbugs.gnu.org; 4 Sep 2021 17:23:41 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 13:23:41 2021
Received: from localhost ([127.0.0.1]:48523 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1mMZOH-0002Kl-Fu
	for submit@debbugs.gnu.org; Sat, 04 Sep 2021 13:23:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:48940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <taylan.kammer@gmail.com>) id 1mMZOE-0002KV-3a
 for submit@debbugs.gnu.org; Sat, 04 Sep 2021 13:23:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60398)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <taylan.kammer@gmail.com>)
 id 1mMZOD-0001pb-Tb
 for guix-patches@gnu.org; Sat, 04 Sep 2021 13:23:37 -0400
Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44832)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <taylan.kammer@gmail.com>)
 id 1mMZO8-0005yH-53
 for guix-patches@gnu.org; Sat, 04 Sep 2021 13:23:37 -0400
Received: by mail-wr1-x435.google.com with SMTP id d6so2659032wrc.11
 for <guix-patches@gnu.org>; Sat, 04 Sep 2021 10:23:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=XxI2mVFaSsqCH9kgktP2OF4m8mHdo2iPuiSSTu18kzs=;
 b=kvfCgyF/tZ2VZnSt0/WTbznCqc7NBDLuh29lvOmR4xguhRq9NEodum00KwEw6wXnDD
 nXCsE8C0ZHOVzh5Pm9NjrdBhmHPYHs/uOI+q6v0U6NIT+2qa1i3jlv1fdSgjUOP7YmIk
 ukr1CCBUmH6OJqR+mtkpbWVQr2NrXPg+HHOWjel/n+e7Ws7/IRQJI3pf1E3sR0Mr6rBz
 pXCSgQ4mR30+N2XdCg2RzP4rMap2fjZlHy26/DxWMKc5UBNCnlsHV9ktNJ1yATthcpfh
 7W3taDK3UZV07KVMGOIq2uec1egka5eJO7r1rRq9ZWWvrnSsHVuLIqmO7k8o/sUyj3Pz
 tLGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language;
 bh=XxI2mVFaSsqCH9kgktP2OF4m8mHdo2iPuiSSTu18kzs=;
 b=jVf//X1VBqvcXgHBOw6cO6W0A2NwQvhcxMNbZgsv+bUno4Jxi2JMUsJjMeElhEbQ2V
 JYl5cN7fl7LxQe9BdNZ02p/EZTgWEKkZxoFho6mwWbLrwscKpc2M5IOKnoUFA5ji0d2Z
 NYZCXeaQsEg8YwxTDkIU6VU2Emzip3rjqub8wjRpeHQrm0viR5VGJv6GUY48e3p90pAL
 jI+Rb9e8eICSOcPiSycCwC3//VcH+E/mwQU+DHZIAqBH/Oy0dumExsrFeNxQSz1VtS6i
 k4NJxrsCKdJWlPrh69u0zP9Vwn/pFGPUZoSatRT8nRuZ3t6EqeBTXc+DT+jzuRm9xFwS
 svCg==
X-Gm-Message-State: AOAM531wgXIGvECF9Mt24b+EAwR6gm9jpwM6s0g3jxI4O/tvtIUg7KjE
 JTu2lTwyDaJ6fmlXOIU6jTaJ2DOPP/r3ZQ==
X-Google-Smtp-Source: ABdhPJw9Yia6V38orlRIRoXIRu/T0IVW0IpXxNmkdKVfmkkJZrsIhC86w7O3OAe/D/EzwmMWjAxsyQ==
X-Received: by 2002:a05:6000:92:: with SMTP id
 m18mr4788587wrx.293.1630776210758; 
 Sat, 04 Sep 2021 10:23:30 -0700 (PDT)
Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz.
 [109.90.125.150])
 by smtp.gmail.com with ESMTPSA id r25sm1445754wrc.26.2021.09.04.10.23.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 04 Sep 2021 10:23:30 -0700 (PDT)
Subject: Re: bug#50349: [PATCH] packages: Add 'define-package' syntax.
To: Tobias Geerinckx-Rice <me@tobias.gr>
References: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev>
 <757b7543b931335c3725264edfbc79c012aa10fc.camel@telenet.be>
 <87y28caazy.fsf@nckx> <95c92fc5-1fcf-b347-370e-d1943f22c2c3@gmail.com>
 <87bl58wfk7.fsf@nckx>
From: Taylan Kammer <taylan.kammer@gmail.com>
Message-ID: <a93161dd-4425-f722-fa43-273ff9561916@gmail.com>
Date: Sat, 4 Sep 2021 19:23:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <87bl58wfk7.fsf@nckx>
Content-Type: multipart/mixed; boundary="------------854501781A1FF47DDFCE933E"
Content-Language: en-US
Received-SPF: pass client-ip=2a00:1450:4864:20::435;
 envelope-from=taylan.kammer@gmail.com; helo=mail-wr1-x435.google.com
X-Spam_score_int: -58
X-Spam_score: -5.9
X-Spam_bar: -----
X-Spam_report: (-5.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 NICE_REPLY_A=-3.832, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Debbugs-Envelope-To: submit
Cc: 50349@debbugs.gnu.org, Sarah Morgensen <iskarian@mgsn.dev>,
 Maxime Devos <maximedevos@telenet.be>, guix-patches@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>
[Message part 1 (text/plain, inline)]
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'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. :-)

-- 
Taylan
[test1.scm (text/plain, attachment)]
[test2.scm (text/plain, attachment)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 16:35:09 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.