From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eCXyH8ybfmMXBQEAbAwnHQ (envelope-from ) for ; Wed, 23 Nov 2022 23:16:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6J3NH8ybfmP+5QAAauVa8A (envelope-from ) for ; Wed, 23 Nov 2022 23:16:44 +0100 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 3EA583EDF9 for ; Wed, 23 Nov 2022 23:16:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxy2Z-0001bF-QF; Wed, 23 Nov 2022 17:16:23 -0500 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 1oxy2X-0001ak-NQ for guix-devel@gnu.org; Wed, 23 Nov 2022 17:16:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxy2X-00082n-E5; Wed, 23 Nov 2022 17:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=9yebrly1MTWXaHh/kvAMLpyUmC6I78q+EmFytJlcXa0=; b=P+P+wI2Bav0i2tq/rrX4 d6VRO9WmOKeLY06MrepRQOQfLz5LQ37FdnPbmXXhVgNFXzxGaabpVyVUhHC0mido68c7tJRlbQdWu xgjXd1Z55uejqx32cKXmkGJqaUTAewSx9ZUYmV8gUjoA6klx7TfCLPYsB1JNjdE0l7RINU8C/vsUC R6az4hG3oEqqjAGgsY28/Hig0LPDaSVhBeocA6VhL8ckvWWMquge9YG4zirOo4cA1jh0BWC7K5tzJ 5pLMF2PtTyehCaIoRA5Vix8PY8XtOH5ZKVlusbmNGOxe88AhmuzXMA4L2NNxnRJRTSLq4QFtWSP0l 1Zfh8k/EMdPq+w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxy2W-00044X-Mn; Wed, 23 Nov 2022 17:16:20 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Cc: guix-devel Subject: Re: RFC: libgit2 is slow/inefficient; switch to git command? References: <87cz9fpw4x.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 3 Frimaire an 231 de la =?utf-8?Q?R=C3=A9volut?= =?utf-8?Q?ion=2C?= jour de la =?utf-8?Q?Chicor=C3=A9e?= 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: Wed, 23 Nov 2022 23:16:18 +0100 In-Reply-To: <87cz9fpw4x.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 21 Nov 2022 21:21:02 -0500") Message-ID: <87mt8he2q5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669241804; 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:dkim-signature; bh=9yebrly1MTWXaHh/kvAMLpyUmC6I78q+EmFytJlcXa0=; b=axWNaIB7S4AZhm7PENgFyKcLDUN8zuTZ7Z/lyQZGMGcr6cSR2qHOXagpfMcT9LRhRWlJjz Aqra7lBTK6c5vlQnwmgbILV/A7wk2nJ4326kFLTNAlD0Gld3uPyZAZv2Z/Xt2ISfMVcsn+ /FsQ8v8Lj9PXO4XTEJCd1IelnMlX0vKX8cWccnG9ZiWbh9xjoQHzkLgDPiZY+lY6HweqQY yPA8hLixINAmPZlrPiULxqu5uzm70+lmyQOMCUK5Dpk5I3emGO/ZjupD9iakNAvtr6C/7w WgAVQ/WJOo1g+UekWxBfCoZKxnLKNaR4ZyoR3ef15YLQdmeAUia8lGAOYNH89A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669241804; a=rsa-sha256; cv=none; b=uhuhlPu1iOJ74TmBGshi/KTwOaK/ljaSkEQT7l9oRI4qYQH39MNL7eo2QdcRVRBkPo0kqm GFFnddS+5DawYTTphCRn5r+8H+v9nA5IzGDfIFtAJgzcsocPdS2/GpvJCF7F1YQckG4ZPL bkMqd0/mGlyvCNXr5d4Bww15vShIsZZZG7QZYAd++Iifs75zePN7n3c04MxPsYgU5L3JqK CMwY2sKcyV+ohtVMe2B9BB60HxfVNGeskUTePu/UaOnhDsbPN9wXWgZZ/zplgjjw69FnkM IGS2WVlCy0a6kVkPhwHvXDBNsenQuEqbfXjdg9J3ziGUIAA2zFOyrdWuUKx+aA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=P+P+wI2B; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -4.19 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=P+P+wI2B; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 3EA583EDF9 X-Spam-Score: -4.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: D4TyxawPXc4g Hi, Maxim Cournoyer skribis: > While attempting to bisect against the Linux kernel tree, the > performance of libgit2 quickly became problematic, to the point where > simply cloning the repo became a multiple hours affair, using upward to > 3 GiB of RAM for the clone and indexing of the objects (!) Did you confirm with a pure Guile-Git snippet that calls =E2=80=98clone=E2= =80=99 that this is the behavior observed? > Given that: > > * the git CLI doesn't suffer from such poor performance; > * This kind of performance problem has been known for years in libgit2 > [0] with no fix in sight; This reports talks about 5x wall-clock time, which is obviously not great, but it doesn=E2=80=99t talk about memory usage, does it? It talks about SHAttered though; that=E2=80=99s a key consideration to make= sure we=E2=80=99re doing an apples-to-apples comparison. > * other projects such as Cargo support using the git CLI and that > projects are using it for that reason [1]; Should we follow Cargo=E2=80=99s lead for packaging as well? :-) > Would it make sense to switch to use the git command directly instead of > calling into this libgit2 C library that ends up being slower? It would > provide a hefty speed-up when using 'guix refresh' or building new > packages fetched from git without substitutes, or using 'git-checkout', > etc. > > What do you think? I think that=E2=80=99s not an option. The level of integration we have in = (guix git), (guix channels), etc. is not achievable by shelling out to =E2=80=98g= it=E2=80=99. "Philip McGrath" skribis: > Along those lines, there=E2=80=99s an implementation of clone/checkout in= pure Racket (for the package manager) that could probably be ported to Gui= le relatively easily. I=E2=80=99d expect libgit2 to be faster for the thing= s that it supports, but the Racket implementation does support shallow chec= kout, so it might pay off if that skips a lot of work. > > Code: https://github.com/racket/racket/blob/master/racket/collects/net/gi= t-checkout.rkt > Docs: https://docs.racket-lang.org/net/git-checkout.html That sounds like a worthy avenue; support for shallow clones would already be an improvement. > (More broadly, I haven=E2=80=99t investigated performance issues, but my = basic inclination would be toward improving libgit2 over running the git ex= ecutable.) Same here. The way I see it, we could gradually move bits of Guile-Git to being pure Scheme. So perhaps the first step would be to provide a pure Scheme =E2=80=98clone=E2=80=99 based on the Racket code above? Thanks, Ludo=E2=80=99.