From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 02 09:04:23 2020 Received: (at 44053) by debbugs.gnu.org; 2 Nov 2020 14:04:23 +0000 Received: from localhost ([127.0.0.1]:40201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZaRb-0006eB-3U for submit@debbugs.gnu.org; Mon, 02 Nov 2020 09:04:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZaRZ-0006dx-J5 for 44053@debbugs.gnu.org; Mon, 02 Nov 2020 09:04:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46568) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZaRU-0007vG-Ax; Mon, 02 Nov 2020 09:04:16 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51260 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZaRT-0006O3-Pq; Mon, 02 Nov 2020 09:04:16 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#44053: =?utf-8?Q?=E2=80=98xdg-mime-database=E2=80=99?= profile hook is slow 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> <87sg9sm2qf.fsf@gnu.org> <87ft5rncn5.fsf@gnu.org> Date: Mon, 02 Nov 2020 15:04:14 +0100 In-Reply-To: <87ft5rncn5.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 02 Nov 2020 13:53:18 +0100") Message-ID: <87blgflush.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-Debbugs-Envelope-To: 44053 Cc: guix-devel , Luis Felipe , 44053@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > Ludovic Court=C3=A8s skribis: > >> 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 hav= e it. >> So in practice, we=E2=80=99re often rebuilding the exact same database. > > On closer inspection, the time-consuming bit is processing > =E2=80=98share/mime/packages/freedesktop.org.xml=E2=80=99 (from =E2=80=98= shared-mime-info=E2=80=99), > which is quite large and leads to the creation of hundreds of file. We > end up re-processing it every time. This is particularly wasteful > because the =E2=80=98shared-mime-info=E2=80=99 package already contains t= he result of > applying =E2=80=98update-mime-database=E2=80=99 to itself. Based on these observations, I added a fast path to the =E2=80=98xdg-mime-database=E2=80=99 hook: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D76ea70bd70aeb7657= 0445c11cea2f98139192b54 It=E2=80=99s down to 0s in the common case where the profile doesn=E2=80=99= t contain any packages providing =E2=80=98share/mime/packages=E2=80=99. Ludo=E2=80=99.