From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4Nl5MPh4I2fKpAAA62LTzQ:P1 (envelope-from ) for ; Thu, 31 Oct 2024 12:32:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 4Nl5MPh4I2fKpAAA62LTzQ (envelope-from ) for ; Thu, 31 Oct 2024 13:32:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EbXpv1mG; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1730377976; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nB9AWa2WYzyte/4RJaMdz3jd0c2bPPn7pSPRXrC7HeQ=; b=mi11GSo3uMqjxVxwt1xkYo0iPQ9OkuYIJdafVCv4uhcRW76HJUeinAbhBAaFDePMa22jfh 9zn0nLunWkOwrkmqlPA57kyKk1/r6Ega43t7KPq2N5SmzHopZmrfY/WLVwh9nKDWZUd8Fw UC7IAU8gnOuH1Ru7OhCrpr4+ZRy3Ur/kiYP0Qe0ddOKizoTuqlWs1AmAvxaXsCO66UatMf Rtjo5Q5eX2C0jfdAyIC3qxz84A4GCXVob3F+BFZrfhKgSFKQ3+QoH7dsuocZdZyZNos1nL yotAR3eXGNK0SoWuXgOrvw79TfIOv/yt8aViUv58U8GLRIMICu09j1WjTVhZkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1730377976; a=rsa-sha256; cv=none; b=t8zZTmFRlY56AB4h7CgZ22xinFVpNPndcQx6x1XdkR8Ap9MWZKH4FseLnmOgnHFqYFJGpf 6FehN6DaIHmrWGLDvDSb8HkM+S7BDPWvYR5S8dxW5ou547jVlVVteSXlNh+nihAhp6EPhV Kj+VkAbUZ8iu3ViM3Y8zDpO3nOUoM8c5yxZ2uHQMP80SbmBjwkWf34FrozituG0XeT1PAT sbkjkgxJ2Zw7LNNUqvlVGxPg3cHDVfxAQKWXuC/twLtBwIhOqmqPIVrYwcqtsTMrvVcCyB HnjPN0f/aotqSVB/1uEeWuawK8DgIAStEMCJOq7NCOhNLGwi63oznEIXbUR29w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EbXpv1mG; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7D4C15B05B for ; Thu, 31 Oct 2024 13:32:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ULX-0007Zg-Sn; Thu, 31 Oct 2024 08:32:15 -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 1t6ULU-0007ZG-C5 for guix-devel@gnu.org; Thu, 31 Oct 2024 08:32:12 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6ULS-0007xE-AE for guix-devel@gnu.org; Thu, 31 Oct 2024 08:32:12 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a9a0ef5179dso127673166b.1 for ; Thu, 31 Oct 2024 05:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730377927; x=1730982727; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nB9AWa2WYzyte/4RJaMdz3jd0c2bPPn7pSPRXrC7HeQ=; b=EbXpv1mGRsiYjg4ev5cXZWJ1hOAbDcsPv9u4kukb2ckvOGiyeHYmk/P5kp+qARtRja LA3hbjYwSDz5JJcD28fOdQ/e0sYAI+2j1yTiRR72jeP7MJSsQWeZFOigxlBwQYyGxupa 0lO1+IdqSA9ao4fjm3bRt/FgdOiIqxdYknPuKcwSa78cgGTwzpLgj+uBk5cm0XoQfqoH +kBOjvVKiVkMqaZFN6ZDWj7GhK92RDtyXuSCa5inKOl2mcJ2eW62DW7dAdFKQWMW5IXo hyFiS1jY2kGscnIqAAgVwAFlp0h+ZGUIwnxWLIGTQwCJr6PRff8WVgWu20lTBITRupy8 s/kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730377927; x=1730982727; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nB9AWa2WYzyte/4RJaMdz3jd0c2bPPn7pSPRXrC7HeQ=; b=eZtR71q29ocrLO7IvHRb0Fx2TSsIcHFHKekLqcWe9YIOWkiNloo30dXet1jWu59BqE wao5RViSHTbEEu0Yiyi2MXdHKBZmlr1+98uQdo8xSBf4xIAeWuwR7nn9u7CU3JHw0Qpc L3wnijdksaGS2r14g8GeMczicoRKYTG1ypdURlIYG19dkyAcgzR/OneuFgNfvG6BxG58 K45y0BB6dxmiSXJP16tYSmLMunh7JUJw/kL+HAgBPK4ATmEgDwq61pVMMnd4cNW4MvuP tUEor1JbBwzI/y7pCR6YggDwzHS3WZn7Ay8zhn/JnZGJ3bB/g843l58vejxVGON1gEZL HnLQ== X-Gm-Message-State: AOJu0Yy/qbAUphWdnUxgFUKlVhtyaztUMkAh8huCieqWW5J1YWUbjJnY eDsSG0xc2Y9lX2e/PhejJiu6YkkYGDux+aWfvjQXV1UvHd+CzDmBj+k3TVnntcWNawwwmO/1cXp K57pPUYHzmOzW/FzU8k6+xqgRGiM= X-Google-Smtp-Source: AGHT+IF09uwgPBp1iIk9h24q3aHOYt6k3iXFKqtofJJtnlFJIL/NatzbguqkBwDEluxWjIK78s013Cm8CRMj0rVRRU4= X-Received: by 2002:a17:906:794b:b0:a99:5601:7dc1 with SMTP id a640c23a62f3a-a9de61d4377mr1813418366b.49.1730377926819; Thu, 31 Oct 2024 05:32:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniel Littlewood Date: Thu, 31 Oct 2024 12:31:54 +0000 Message-ID: Subject: Re: Including code in a non-Guile language into Guix To: Evan Cooney Cc: guix-devel Content-Type: multipart/alternative; boundary="000000000000a7cad80625c50177" Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=danielittlewood@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, 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-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.24 X-Spam-Score: -4.24 X-Migadu-Queue-Id: 7D4C15B05B X-Migadu-Scanner: mx13.migadu.com X-TUID: DJnaYarBW+hN --000000000000a7cad80625c50177 Content-Type: text/plain; charset="UTF-8" Hi Evan, Some guix commands are indeed quite slow. This has been the subject of discussion on the mailing list previously. I found one example from a year ago, but I guess there are others: https://lists.gnu.org/archive/html/guix-devel/2023-06/msg00085.html That being said, I would recommend caution in your conclusions for two reasons: 1. Most distributions are not a like-for-like comparison with Guix. The only distro I would consider directly comparing with in terms of performance would be NixOS. Installation of software on guix requires strictly more work than, say, on Debian or Arch, because it provides more guarantees than those distributions do in terms of reproducibility. Others on the list can probably speak more to the details of why or how much slower it should be expected to be. However, Guix *is* noticeably slower than Nix is, so your observation is still correct. 2. Programme performance is a complex topic, and it is a common misconception that programs written in C are always, or typically, faster than counterparts in garbage-collected languages. This is not really true in many cases, particularly when costs of development are considered. I assume that having a C core, or splitting out parts of Guix into C, was considered early on in development. After all it is kind of the point of guile that it interfaces well with C. Other members of the lost may be able to give the historical context. Having said that, I wonder (and could not find out) whether there is quantitative data on how fast/slow Guix is for common operations. If you could do some timings of what you think "too slow" means (e.g. for a guix pull, or guix shell PKG). Some data from me, using Guix on a foreign distro (Debian) guix pull ("38k new commits"): 21m45s guix pull immediately after: 2m25s guix shell emacs (fresh): 1m49s guix shell emacs (cached): <1s apt update: 2s apt install emacs: 2s nix-channel --update: 0m23s nix shell -p emacs (fresh): 0m24s nix-shell -p emacs (cached): 4s The apt commands are really not a fair comparison. In particular I noticed the Guix command had to pull in all dependencies, while apt seemingly had everything readily available. Note that I did apt remove emacs before installing, but nothing else. I'm not sure whether the nix/guix comparisons are fair. I might have more installed in Guix vs nix. All the best, Dan On Thu, Oct 31, 2024, 06:50 Evan Cooney wrote: > Hello everyone, > > My name is Evan Cooney. I use GNU Guix but I'm pretty new to it, I'm also > not a professional, I mostly program for fun and I'm mostly self-taught. I > was watching some videos about software performance and optimization, which > brought to mind that, at least on my computer, guix package commands > (particularly search, install, and remove) run much slower than the > equivalents on other distros I've used. I know that Guix is mainly written > in Guile, but has much thought gone into optimizing these commands by > rewriting some of the code in a more performance-oriented language like C? > Guile is designed for interoperability with C code, and many other GNU > programs (gcc, coreutils, gdb, bash, etc.) are written in C or similar > languages. C is also more widely taught and known than Guile, so adding C > might help bring developers to Guix. I would love to try to work on > optimizing the performance of these commands and any help would > be appreciated. > > Thanks, > Evan Cooney > --000000000000a7cad80625c50177 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Evan,

Som= e guix commands are indeed quite slow. This has been the subject of discuss= ion on the mailing list previously. I found one example from a year ago, bu= t I guess there are others:


That being said, I= would recommend caution in your conclusions for two reasons:

1. Most distributions are not a like-= for-like comparison with Guix. The only distro I would consider directly co= mparing with in terms of performance would be NixOS. Installation of softwa= re on guix requires strictly more work than, say, on Debian or Arch, becaus= e it provides more guarantees than those distributions do in terms of repro= ducibility. Others on the list can probably speak more to the details of wh= y or how much slower it should be expected to be. However, Guix *is* notice= ably slower than Nix is, so your observation is still correct.

2. Programme performance is a comple= x topic, and it is a common misconception that programs written in C are al= ways, or typically, faster than counterparts in garbage-collected languages= . This is not really true in many cases, particularly when costs of develop= ment are considered.

I a= ssume that having a C core, or splitting out parts of Guix into C, was cons= idered early on in development. After all it is kind of the point of guile = that it interfaces well with C. Other members of the lost may be able to gi= ve the historical context.

Having said that, I wonder (and could not find out) whether there is qua= ntitative data on how fast/slow Guix is for common operations. If you could= do some timings of what you think "too slow" means (e.g. for a g= uix pull, or guix shell PKG).

Some data from me, using Guix on a foreign distro (Debian)

guix pull ("38k new commits&q= uot;): 21m45s
guix pull immediately after: 2m25s
guix shell emacs (fresh): 1m49s
= guix shell emacs (cached): <1s

apt update: 2s
apt install emacs: 2s
=

nix-channel --update: 0m23s
nix shell -p emacs (fresh): 0m24s
nix-shell -p emacs (cached): 4s

The apt commands are really not a fair comparison. In particula= r I noticed the Guix command had to pull in all dependencies, while apt see= mingly had everything readily available. Note that I did apt remove emacs b= efore installing, but nothing else.

I'm not sure whether the nix/guix comparisons are fair. I m= ight have more installed in Guix vs nix.

<= div dir=3D"auto">All the best,
Dan

On Th= u, Oct 31, 2024, 06:50 Evan Cooney <evancooney71@gmail.com> w= rote:
Hello everyone,

My name is Evan Cooney. I use GNU G= uix but I'm pretty=C2=A0new to it, I'm also not a professional, I m= ostly program for fun and I'm mostly self-taught. I was watching some v= ideos about software performance and optimization, which brought to mind th= at, at least on my computer, guix package commands (particularly search, in= stall, and remove) run much slower than the equivalents on other distros I&= #39;ve used. I know that Guix is mainly written in Guile, but has much thou= ght gone into optimizing these commands by rewriting some of the code in a = more performance-oriented language like C? Guile is designed for interopera= bility with C code, and many other GNU programs (gcc, coreutils, gdb, bash,= etc.) are written in C or similar languages. C is also more widely taught = and known than Guile, so adding C might help bring developers to Guix. I wo= uld love to try to work on optimizing the performance=C2=A0of these command= s and any help would be=C2=A0appreciated.=C2=A0

Th= anks,=C2=A0
Evan Cooney
--000000000000a7cad80625c50177--