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 gG6MEesRoF/dAQAA0tVLHw (envelope-from ) for ; Mon, 02 Nov 2020 14:04:27 +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 SHRtDesRoF8YfwAAB5/wlQ (envelope-from ) for ; Mon, 02 Nov 2020 14:04:27 +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 0C6109407EA for ; Mon, 2 Nov 2020 14:04:27 +0000 (UTC) Received: from localhost ([::1]:38746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZaRe-0000Ze-1i for larch@yhetil.org; Mon, 02 Nov 2020 09:04:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZaRU-0000ZK-LP for guix-devel@gnu.org; Mon, 02 Nov 2020 09:04:16 -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-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , Luis Felipe , 44053@debbugs.gnu.org, Maxim Cournoyer Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" 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 guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: 9orLPJvK7rYZ 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.