From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id dKrDD9Lpn1/HDQAA0tVLHw (envelope-from ) for ; Mon, 02 Nov 2020 11:13:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cIX/CtLpn1+zDgAAB5/wlQ (envelope-from ) for ; Mon, 02 Nov 2020 11:13:22 +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 aspmx1.migadu.com (Postfix) with ESMTPS id AB5F994021E for ; Mon, 2 Nov 2020 11:13:21 +0000 (UTC) Received: from localhost ([::1]:38038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZXm3-0001Xt-VY for larch@yhetil.org; Mon, 02 Nov 2020 06:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZXlo-0001Wk-1q for bug-guix@gnu.org; Mon, 02 Nov 2020 06:13:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZXlm-0003YK-8q for bug-guix@gnu.org; Mon, 02 Nov 2020 06:13:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZXll-0004HE-VX for bug-guix@gnu.org; Mon, 02 Nov 2020 06:13:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44053: =?UTF-8?Q?=E2=80=98xdg-mime-database=E2=80=99?= profile hook is slow Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 02 Nov 2020 11:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44053 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: zimoun Received: via spool by 44053-submit@debbugs.gnu.org id=B44053.160431557616426 (code B ref 44053); Mon, 02 Nov 2020 11:13:01 +0000 Received: (at 44053) by debbugs.gnu.org; 2 Nov 2020 11:12:56 +0000 Received: from localhost ([127.0.0.1]:39896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZXlf-0004Gr-S3 for submit@debbugs.gnu.org; Mon, 02 Nov 2020 06:12:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZXle-0004Gf-1e for 44053@debbugs.gnu.org; Mon, 02 Nov 2020 06:12:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43453) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZXlY-0003Tm-KS; Mon, 02 Nov 2020 06:12:48 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50808 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZXlS-0007Sp-OZ; Mon, 02 Nov 2020 06:12:44 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87o8l7pple.fsf@gnu.org> <87h7qxhncq.fsf@gnu.org> <3aQjRn5jGhxHrhAmuB3MfLRjSxAp3PVFu1vL7_GV1ucGibzYURCtMqHN4oeyGb5xez2xYM3loEJIECrVdnAGZBZvf0N1bGXN-80mO6Ymr6k=@protonmail.com> <87sgagv8qt.fsf@dismail.de> <87o8l279eb.fsf@gnu.org> <4JD1z15e92ccv6WXcMS5IiNJnDwR6P3bkIwtPWLUPYDVCUHYDoekpifyj3GQtnEq1LCKftbL-FV1hp162A1mid2EmjLMbWlxQ05aE9vGyf0=@protonmail.com> <87v9f842uu.fsf@gmail.com> <87v9f7gspm.fsf@dismail.de> <874kmn9adz.fsf_-_@gnu.org> <87ft5zqn2a.fsf@dismail.de> Date: Mon, 02 Nov 2020 12:12:40 +0100 In-Reply-To: <87ft5zqn2a.fsf@dismail.de> (Joshua Branson's message of "Tue, 27 Oct 2020 19:14:05 -0400") Message-ID: <87sg9sm2qf.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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , Luis Felipe , 44053@debbugs.gnu.org, Maxim Cournoyer Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: Qmy0JVJUFb7D Hi, Joshua Branson skribis: > The "XDG MIME database" takes a while. > > #+BEGIN_SRC sh :results output :exports both > time guix build --check $(guix gc -R $(guix gc --derivers $(readlink -f ~= /.guix-profile)) |grep xdg-mime-database.drv) > #+END_SRC > > > #+RESULTS: > : The following profile hook will be built: > : /gnu/store/lmhklgdscbfp5c6gl81skyz0azfg156m-xdg-mime-database.drv > : building XDG MIME database... > : successfully built /gnu/store/lmhklgdscbfp5c6gl81skyz0azfg156m-xdg-mime= -database.drv > : successfully built /gnu/store/lmhklgdscbfp5c6gl81skyz0azfg156m-xdg-mime= -database.drv > : /gnu/store/x8q8g9l0jhrpmjjm3xsh3ib1z8l79cyx-xdg-mime-database > : > : real 0m43.716s > : user 0m3.626s > : sys 0m0.258s I found that the MIME database is computed only over the subset of the packages in your profile that provide =E2=80=98share/mime/packages=E2=80=99= , plus =E2=80=98shared-mime-info=E2=80=99. In my profile, only LibreOffice provides that directory, so the union is made over these two directories and that=E2=80=99s what =E2=80=98update-mim= e-database=E2=80=99 works on. Apart from LibreOffice, I found that =E2=80=98share/mime/packages=E2=80=99 = is provided by at least: hugin, gcr, fontforge. Most GUI packages don=E2=80=99t have i= t. So in practice, we=E2=80=99re often rebuilding the exact same database. Here=E2=80=99s the time taken by =E2=80=98update-mime-database=E2=80=99 alo= ne: --8<---------------cut here---------------start------------->8--- ludo@ribbon ~$ mkdir -p /tmp/mime/share/mime/packages ludo@ribbon ~$ cd /tmp/mime/share/mime/packages ludo@ribbon /tmp/mime/share/mime/packages$ for i in $(guix build libreoffic= e ^C ludo@ribbon /tmp/mime/share/mime/packages$ for i in ~/.guix-profile/share/m= ime/packages/* ; do ln -s $i ; done ludo@ribbon /tmp/mime/share/mime/packages$ ls -l totalo 8 lrwxrwxrwx 1 ludo users 64 Nov 2 11:46 freedesktop.org.xml -> /home/ludo/.= guix-profile/share/mime/packages/freedesktop.org.xml lrwxrwxrwx 1 ludo users 60 Nov 2 11:46 libreoffice.xml -> /home/ludo/.guix= -profile/share/mime/packages/libreoffice.xml ludo@ribbon /tmp/mime/share/mime/packages$ cd /tmp/mime/ ludo@ribbon /tmp/mime$ time update-mime-database -V /tmp/mime/share/mime Updating MIME database in /tmp/mime/share/mime... Parsing source file /tmp/mime/share/mime/packages/freedesktop.org.xml... Parsing source file /tmp/mime/share/mime/packages/libreoffice.xml... Wrote 1124 strings at 2c - 6310 Wrote aliases at 6310 - 6be4 Wrote parents at 6be4 - 8468 Wrote literal globs at 8468 - 855c Wrote suffix globs at 855c - 13514 Wrote full globs at 13514 - 13554 Wrote magic at 13554 - 2065c Wrote namespace list at 2065c - 20798 Wrote icons list at 20798 - 2079c Wrote generic icons list at 2079c - 213b8 Wrote types list at 213b8 - 22020 Note that '/tmp/mime/share' is not in the search path set by the XDG_DATA_HOME and XDG_DATA_DIRS environment variables, so applications may not be able to find it until you set them. The directories currently searched are: - /home/ludo/.local/share - /home/ludo/.guix-profile/share - /run/current-system/profile/share - /home/ludo/.guix-profile/share - /run/current-system/profile/share real 0m2.166s user 0m0.278s sys 0m0.056s --8<---------------cut here---------------end--------------->8--- To be compared with: --8<---------------cut here---------------start------------->8--- $ drv=3D"$(guix gc -R $(guix gc --derivers $(readlink -f ~/.guix-profile)) = |grep xdg-mime-database.drv)" $ time guix build --check $drv The following profile hook will be built: /gnu/store/jrmwsxpz3wmq37zx29lvb0r9nvcmdviz-xdg-mime-database.drv building XDG MIME database... successfully built /gnu/store/jrmwsxpz3wmq37zx29lvb0r9nvcmdviz-xdg-mime-dat= abase.drv /gnu/store/npvj2sr9kxx48znh7zc8zmzwzs6brc90-xdg-mime-database real 0m3.670s user 0m1.428s sys 0m0.029s --8<---------------cut here---------------end--------------->8--- Thus, the build time itself is entirely taken by =E2=80=98update-mime-datab= ase=E2=80=99 (the 1.4s above is =E2=80=9Coverhead=E2=80=9D in =E2=80=98guix build=E2=80= =99 it would seem). Ludo=E2=80=99.