From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iPhpOJ6BP2VPPAEAauVa8A:P1 (envelope-from ) for ; Mon, 30 Oct 2023 11:12:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iPhpOJ6BP2VPPAEAauVa8A (envelope-from ) for ; Mon, 30 Oct 2023 11:12:46 +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 A0D1367590 for ; Mon, 30 Oct 2023 11:12:46 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698660766; a=rsa-sha256; cv=none; b=MClMkPsbhbLT41jKJGPzoqpBC5hNccc1mofjZp5+ljr8zPeu3Yc6pU8OBzjDDLn/4JcK40 Dd/tyvc6NTGGTVRm5D2mdxgjROXKj7sTAxNlXWzFqd5Tex52JaCcqLPwXCvJ7rb8qJW/OD 1rwGpZfmhO8kUOZI0dtUz/dnX3uM4olic5oQ6iOjne7kevyeuYGK99421+dzaMZ3uqS/sl 7KjmYuRUi32ojOC64AyGzg6SvaMff5eXxxwxOWlHSF73+08N7nt/gRMGHOcDuqjqLNTy1X zZo9i0LvIPKRT9CRqdPyYQ+oVaMlFL6huPaY5/dpvn2iFW4MARKsBOSJq6yumA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698660766; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=thdxPkC+Y87CSOr+G9LkX5+a8ukgxK1a//P5FfXyNdU=; b=mhUCVQIEk1fYC5wqi934MQf2rf0VKEHkpOTiL62YMq2/56GUW/GROYO4FSu948Kojn08ca S4iH46fsG15mGOScG0AH5iy2sw3OD7x/0vaUvObvG+1YsB6nSEvQExeEEtX+wbnSb74R+t 2ExpB83m8A1VS2yFyyVrQE7FYnF1OgVwmkqzXQ80XchZreDaRLUVjbrybfq+4BBjM1g/7A lGgR1bvXfvZaj+6YpKHAiv5VkpHxhFKWhV4rnTSW/NJIb+H3unpco8MGA7T0v3JCLF14+/ zw8M/4GtnCwfMqG9qGu0E7hJPdwXEJggmXzBvC5wflEm1MHN/UY8SQmcBwFMFA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxPFq-0006bR-6J; Mon, 30 Oct 2023 06:12:18 -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 1qxPFn-0006b1-Ny for guix-devel@gnu.org; Mon, 30 Oct 2023 06:12:15 -0400 Received: from mira.cbaines.net ([212.71.252.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxPFm-0003zD-0p for guix-devel@gnu.org; Mon, 30 Oct 2023 06:12:15 -0400 Received: from localhost (pd95b13b0.dip0.t-ipconnect.de [217.91.19.176]) by mira.cbaines.net (Postfix) with ESMTPSA id 055FE27BBE2 for ; Mon, 30 Oct 2023 10:12:11 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id c6bbc319 for ; Mon, 30 Oct 2023 10:12:10 +0000 (UTC) User-agent: mu4e 1.10.5; emacs 28.2 From: Christopher Baines To: guix-devel@gnu.org Subject: Performance of computing cross derivations Date: Mon, 30 Oct 2023 10:03:25 +0000 Message-ID: <87zg00xvuv.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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-Queue-Id: A0D1367590 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.70 X-Spam-Score: -7.70 X-TUID: z988ykIYsuhP --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hey! When asked by the data service, it seems to take Guix around 3 minutes to compute cross derivations for all packages (to a single target). Here's a simple script that replicates this: (use-modules (srfi srfi-34) (gnu packages) (guix grafts) (guix packages) (guix store) (statprof)) =20=20 (define (all-cross system target) (with-store store (%graft? #f) (fold-packages (lambda (package result) (with-exception-handler (lambda (exn) (unless (package-cross-build-system-error? exn) (peek exn)) result) (lambda () (package-cross-derivation store package target system) (+ 1 result)) #:unwind? #t)) 0))) =20=20 (statprof (lambda () (peek "COUNT" (all-cross "x86_64-linux" "i586-pc-gnu"))) #:count-calls? #t) Here's some relevant output: % cumulative self=20=20=20=20=20=20=20=20=20=20=20=20=20 time seconds seconds calls procedure 50.48 126.68 102.40 ice-9/vlist.scm:502= :0:vhash-foldq* 11.49 23.31 23.31 hashq 5.16 10.52 10.47 write 2.79 14.28 5.65 ice-9/vlist.scm:494= :0:vhash-fold* 2.28 4.63 4.63 equal? 2.14 4.35 4.35 hash 1.85 4.67 3.75 guix/packages.scm:1= 874:0:input=3D? 1.78 3.68 3.61 put-string 1.77 7.16 3.59 guix/derivations.sc= m:736:0:derivation/masked-inputs 0.93 1.90 1.90 get-bytevector-n 0.78 1.58 1.58 put-char 0.67 1.36 1.36 search-path ... =20=20 Total time: 202.872232073 seconds (30.927648399 seconds in GC) Over 3 minutes seems like a long time for this, especially since it only computes around 10000 derivations. I don't know how to use statprof, but looking at vhash-foldq* being at the top of the output, is this suggesting that around a third of the CPU time is being spent looking for things in various caches? I had a go at using the Guix profiling stuff and I did get some output, but I couldn't figure out how to get it to show all the caching going on. Any ideas? Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmU/gXhfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xfy9RAAmI5Spim6scDVlPGuXrnCzT4c0B/9PecE zNEREjyp312QdtO0SArdW0moqH6FqVvTx2AP5VGAl5aHJtBL9hmJTIDz4CRaThhf PfB1KYoaM+Z19Kz07EiLpIBYYy86TPXRbZtgDsl3CRGrnUJzvl7c0uKIxJEyLbsy wfuFn4tSPEsg8cWNPIU91xbtQY7Dfj13tsLCIPN4+445HZnSRQ4qSml+3HQ/QNG6 Z4R6zhIMt7H7KCtJQFZWXRI4nSVfPyXKV7GLBVUG8tS2Yj6WL1IoqDwYJODmuVXI GSpVmu+Y8YL+U7CvBh5lMDP9ztHEtPXvCB9ghP0/6kPoiD/1+VJwXPcaDxkJLJl4 LNPetcB6k0jxNgeGSp58hWOacGRp5a6KAgOqzfv1p1+1mKKEZ7YcSPpXxIhZkP2a z26BOCbcIdA1MIStN0wmVxcfG2OzulZ2bW+tJzTYDodlpsZphIDc7Y6fCswwo7Q6 1EGhI4wbDZuI6nMi8tADlGUONms3oDmuETLDPYaQKLozTANgr+RNMDkxRlINjKNy AOCsPZzx4VfwyL0ZCQSTtTFfUQ1W7iaJqKc2TrNgmyfuQ6ApcPpeiXm8oMUdCimA yXn0uGbuEF8KsZ+ddrVEYtZnTQbJW2qijmutQyop7SRxME+IL3Ge0nq6KvzcUYrx kpSiXS30s9U= =U7IC -----END PGP SIGNATURE----- --=-=-=--