From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MGN6AQuKT2ADGAAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 16:23:39 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KBXQOAqKT2C5HAAAB5/wlQ (envelope-from ) for ; Mon, 15 Mar 2021 16:23:38 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 99F5E20B36 for ; Mon, 15 Mar 2021 17:23:38 +0100 (CET) Received: from localhost ([::1]:33036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLq0H-0005hN-Mg for larch@yhetil.org; Mon, 15 Mar 2021 12:23:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLpzp-0005ek-Hg for guix-devel@gnu.org; Mon, 15 Mar 2021 12:23:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45567) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLpzn-0004hU-In; Mon, 15 Mar 2021 12:23:07 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=46278 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lLpzl-0000Qf-FU; Mon, 15 Mar 2021 12:23:07 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ricardo Wurmus Subject: Re: guix environment --profile with --ad-hoc References: <20210309020542.2f5afd65@runbox.com> <8735x4agc5.fsf@ambrevar.xyz> <87ft114fup.fsf@ambrevar.xyz> <86v99wiu07.fsf@gmail.com> <877dmcofp0.fsf@ambrevar.xyz> <87h7lgpqda.fsf@elephly.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 =?utf-8?Q?Vent=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 15 Mar 2021 17:23:03 +0100 In-Reply-To: <87h7lgpqda.fsf@elephly.net> (Ricardo Wurmus's message of "Fri, 12 Mar 2021 12:23:45 +0100") Message-ID: <87pn00fkt4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, pkill9 Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615825418; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CybhgwwnfBerYURzzHze2pnkfS4SqQKw3REs37veKvs=; b=E7TJ9kiV6txQA2KLofkraOOJlO3fpSpFLNl9YBsRJYblWFcNB+nBO2mwxH8ggLf50T9WoN 7Q9QfLs6vKAVUGP2NDrQyCBmZTItUY/WqaEnxX/Pmno4AT4ElTB04h3WYcTvucciJDqv21 ciaxesOqbZjDMWzFj7/i6n65UEu6mBIyT9ROk7z6gojAxF5kmzpmqX3qZVEb7q03y0NnlC LEFligne157dtvxDf97wQYa+pUDeQbQtzXxPrlTHA+WlSqktxAUc2sRb46RhxazvEluRIB 00U2OG6ls/aOH2ri4QxTegTOWBX5MXhJMW5C8AZYrL1ITIYVgtj7WBnBL1rCUg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615825418; a=rsa-sha256; cv=none; b=USd4zuZ1L8y0xgdsZpBxbeePjO5gtq431oj2rf+wAbSmhE9BXCRTmZm3nPRbPUwY6rsWj3 aigemqHt3/9VOHUGynC9Vc8d6Iv6xBTCGIepaPKm8rQ1wJxdgvYEdUfqTiNxdzxWHOOTD8 CUyvu/renTDPc2/0HDkhnsLnu+qwBnqQweKPuO9ZyHXW8kUv+Hn15mVvfHw8T/0IC9mGhC NJ+Pijnk2tKZ/lsdJO1CjVSPP+TvGeoG24PeHOmGqJX28yQoJ+XtlzOUXje/BP3H5PtdXX h6NQHr3a+sMl5nsJlvPx5zaEONgR6yoA9nw7dfTqeygZyPzF0U2DvpFg4kQapw== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=none; spf=pass (aspmx2.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx2.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 99F5E20B36 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: upYZrblxd3Du Hi, Ricardo Wurmus skribis: > strace reveals more. For example, some time is lost searching libraries > and other files. (At least the excessive library searches should > already have been mitigated by changes on the core-updates branch.) > This includes reading .go files, .scm files, reading TLS certs for > guile-gnutls, etc. I think you=E2=80=99re stracing via ./pre-inst-env. =E2=80=98guix=E2=80=99= from =E2=80=98guix pull=E2=80=99 stats less thanks to the optimizations in (@@ (guix self) guix-command): --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env strace -c guix build hello -d /gnu/store/cl250cyzml3sk521y0n6940cr60r481x-hello-2.10.drv % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 54.03 0.009214 1 6542 4863 stat 12.46 0.002124 2 1023 mmap 9.30 0.001585 1 1535 626 openat [...] ------ ----------- ----------- --------- --------- ------------------ 100.00 0.017052 1 14180 5528 total $ strace -c guix build hello -d /gnu/store/cl250cyzml3sk521y0n6940cr60r481x-hello-2.10.drv % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 28.77 0.002299 1 1282 625 openat 20.77 0.001660 1 1519 325 stat [...] ------ ----------- ----------- --------- --------- ------------------ 100.00 0.007991 0 8143 983 total --8<---------------cut here---------------end--------------->8--- (The former is sensitive to the length of GUILE_LOAD_PATH, the latter isn=E2=80=99t.) > I=E2=80=99m guessing that we could avoid some of that searching (and thus > condense a whole lot of stat calls) by constraining things a little > ahead of time. We know the location of Guile modules in advance, so > perhaps we can come up with a way to avoid having to go on > GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH for everything, e.g. by > recording GUIX_ROOT and using that. Yes, that=E2=80=99s what the =E2=80=9Cpackage cache=E2=80=9D built by =E2= =80=98guix pull=E2=80=99 does. Essentially, it makes it so that: guix build hello is equivalent to: guix build -e '(@ (gnu packages base) hello)' > But this is still all rather benign. The real slow-down is due to > talking to the daemon. I=E2=80=99m not sure I understand all the strace = output, > but it looks like we read file names from the daemon socket and then > write the contents of the builders and derivations for these files back > to the daemon socket. > > It=E2=80=99s not clear to me if Guix computes these builders and derivati= ons > from scratch and then sends them over the socket, or if it reads them > from files and sends them over. But it does seem like perhaps we could > avoid some of the work, or at least some of the socket communication > when the daemon could read existing files directly. All the derivations and builders are computed from scratch, so caches (notably the cache that maps packages to derivations) have a huge impact. Ludo=E2=80=99.