From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Memoization profiling Date: Tue, 12 Dec 2017 18:14:20 +0100 Message-ID: <87vahbna1f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOo8U-0003ww-8b for guix-devel@gnu.org; Tue, 12 Dec 2017 12:14:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOo8P-0004ku-Ag for guix-devel@gnu.org; Tue, 12 Dec 2017 12:14:30 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:41836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eOo8O-0004jk-V4 for guix-devel@gnu.org; Tue, 12 Dec 2017 12:14:25 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 979AD7676 for ; Tue, 12 Dec 2017 18:14:26 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TQ4pyNQJp37i for ; Tue, 12 Dec 2017 18:14:24 +0100 (CET) Received: from ribbon (unknown [193.50.110.104]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 4D45D6FF0 for ; Tue, 12 Dec 2017 18:14:24 +0100 (CET) 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel Hello Guix, Memoization plays a critical role in the performance of Guix. I=E2=80=99ve finally added support to profile memoization, which should allow us to better understand how it performs and to use it more wisely: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D252c4083779a488c8= 6e74362b4f3bb4bf927cc67 https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D6c80641d54a95f2da= 95e480a4a746761d25161e9 Here=E2=80=99s an example of what it gives (you need to =E2=80=9Cmake clean= -go && make=E2=80=9D): --8<---------------cut here---------------start------------->8--- $ GUIX_PROFILING=3Dmemoization ./pre-inst-env guix build libreoffice -d --n= o-grafts /gnu/store/x2dk4zwkfvlypmk7havzhk71bgrlbfk3-libreoffice-5.3.7.2.drv Memoization: 113 tables, 34 non-empty guix/utils.scm:744:2: 6274 entries, 7645 lookups, 18% hits guix/derivations.scm:582:2: 1942 entries, 5230 lookups, 63% hits guix/derivations.scm:636:2: 1779 entries, 5066 lookups, 65% hits guix/derivations.scm:629:2: 889 entries, 24116 lookups, 96% hits guix/packages.scm:776:4: 710 entries, 770 lookups, 8% hits gnu/packages/bootstrap.scm:136:2: 307 entries, 7634 lookups, 96% hits guix/build-system/asdf.scm:164:4: 20 entries, 20 lookups, 0% hits guix/build-system/asdf.scm:164:4: 11 entries, 38 lookups, 71% hits guix/packages.scm:776:4: 10 entries, 10 lookups, 0% hits guix/derivations.scm:1028:2: 8 entries, 5116 lookups, 100% hits guix/packages.scm:776:4: 7 entries, 7 lookups, 0% hits guix/build-system/gnu.scm:88:6: 7 entries, 26 lookups, 73% hits guix/packages.scm:776:4: 4 entries, 4 lookups, 0% hits guix/build-system/gnu.scm:88:6: 4 entries, 8 lookups, 50% hits guix/build-system/gnu.scm:88:6: 3 entries, 6 lookups, 50% hits guix/build-system/gnu.scm:88:6: 2 entries, 4 lookups, 50% hits guix/build-system/gnu.scm:88:6: 2 entries, 4 lookups, 50% hits guix/build-system/gnu.scm:88:6: 2 entries, 4 lookups, 50% hits guix/build-system/gnu.scm:88:6: 2 entries, 4 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/packages.scm:776:4: 1 entries, 1 lookups, 0% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 1 lookups, 0% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 1 lookups, 0% hits guix/build-system/gnu.scm:88:6: 1 entries, 4 lookups, 75% hits guix/build-system/gnu.scm:88:6: 1 entries, 7 lookups, 86% hits guix/build-system/gnu.scm:88:6: 1 entries, 1 lookups, 0% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits guix/build-system/gnu.scm:88:6: 1 entries, 1 lookups, 0% hits guix/build-system/gnu.scm:88:6: 1 entries, 2 lookups, 50% hits --8<---------------cut here---------------end--------------->8--- Here memoization stats are dumped when exiting, but you can also force them to be displayed after each GC: --8<---------------cut here---------------start------------->8--- $ GUIX_PROFILING=3Dmemoization GUIX_PROFILING_EVENTS=3Dafter-gc \ ./pre-inst-env guix build libreoffice -d --no-grafts --8<---------------cut here---------------end--------------->8--- The new (guix profiling) module provides basic support for this. Ludo=E2=80=99.