From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OCE/CMaZP2CxfAAA0tVLHw (envelope-from ) for ; Wed, 03 Mar 2021 14:14:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qDfvA8aZP2C5VQAAbx9fmQ (envelope-from ) for ; Wed, 03 Mar 2021 14:14:30 +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 9E27E27DDC for ; Wed, 3 Mar 2021 15:14:29 +0100 (CET) Received: from localhost ([::1]:47868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHSGi-00065f-Qs for larch@yhetil.org; Wed, 03 Mar 2021 09:14:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHSG1-0005UQ-ML for guix-devel@gnu.org; Wed, 03 Mar 2021 09:13:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36534) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHSG1-0008US-FU; Wed, 03 Mar 2021 09:13:45 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36156 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lHSG0-0006ci-VN; Wed, 03 Mar 2021 09:13:45 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: Getting rid of the mandb profile hook? References: <87k0tw3y15.fsf@inria.fr> <87v9ad7jal.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Vent=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 03 Mar 2021 15:13:43 +0100 In-Reply-To: <87v9ad7jal.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 27 Feb 2021 08:05:22 -0500") Message-ID: <87ft1cqq94.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 Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614780869; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sEJeUewWPy+OXRKO5X/g6zQziMzdHcQ/Xqlcodtv7YE=; b=JR8meRXfC+Wy5cB/oCEhtGehmqoT4/LK+DAgBazhpjRwnHPTKzhFdqAyHH7Wm5EVBf7u8A WkFxsAgQQkzKWbbJS1RM48TYP7vGk+D7oVW/CQZRJR7b9HF640KF5M8rDBqoUVoB/OFHa0 6xyxh4pVrHgxjPVNi9/Y7k+9tTQLmXrr60DmuayoPq1JzrXNDddh+0m+AlWXtszDEXyP2J rdCQH1B7/QsTBxHj8CBQ+i6qSnsmOnsPYghMMADGTq8/5d0IaFyiwvg7o7gfv2BLSVLaFy Phj/wMMjdvBCDvbPCwoXrNdeTF6ibYZMsyK4wE/kLfWsdQlsJd94PIncJW3nGw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614780869; a=rsa-sha256; cv=none; b=cNt/Vh3C/SYfU7k58VS/GDO4isFQ6AHNjf78Yt/E+x2jvL4wl6hpCvtSfhJuzyq67C5IYl Ikokhx0OkOo+HPzBIduNks+cpO7onnOXuIwm0h34I1iDBpGzL/oEohq6fkzlCGQDJrKBky +rISs8opbLmPLfmnZhqpJckrt0GFeuyDNy3vxUKVEcJcearXxKQMqBGaHgUNcuQHvpEfUD 14Fza2eBEbzggVuzZxmpRqyYiAM9GbqC9OuWNg3QNtiP4ctF/t9+o/1w5NMvduMMI7rC6t BoQHDlvxQako+f2InL4G0nuIGg8Wg6iUShM51mcBB1os24fxbFcksfaecVx51Q== ARC-Authentication-Results: i=1; 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-Migadu-Spam-Score: -1.86 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-Migadu-Queue-Id: 9E27E27DDC X-Spam-Score: -1.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: zv7fTwH4xo4p Hi! Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Hi Guix! >> >> I was inspired by Michael Stapelberg=E2=80=99s talk recently shared on I= RC=C2=B9 >> (well worth watching!). One of the takeaways for me is that many >> actions should be done lazily, in particular populating caches. >> >> =E2=80=98guix install=E2=80=99 & co. spend a significant time populating= such caches, in >> particular the XDG caches=C2=B2 and the manual page database (mandb). >> >> I=E2=80=99m thinking we could get rid of the mandb hook. However, the >> functionality matters IMO (we need good tools so users can browse local >> documentation; mandb is not that good but better than no search >> mechanism.) Here are several options that come to mind: >> >> 1. Provide a =E2=80=98man=E2=80=99 wrapper or modify the =E2=80=98man-= db=E2=80=99 package such that >> the database gets built on the first use of =E2=80=98man -k=E2=80= =99, unless it=E2=80=99s >> already up-to-date. > > That would mean the database would live in some user-specific writable > area of the file system correct (where?), right? And could use the > common 'update' mechanism of man-db to make it as fast as possible. > > This sounds good from a performance perpective, but could introduce > cache issues every now and then (if man-db changes a lot). I wouldn't > expect much problem given how mature man-db is, but that's one thing to > consider. I looked a bit at man-db, thinking it must have that already done more or less. Indeed, one can run =E2=80=9Cmandb -uc=E2=80=9D to create the dat= abase. The problem is that it insists on writing databases and =E2=80=98CACHEDIR.T= AG=E2=80=99 files in the same directory as man pages. In our case, these are all read-only, so just prints a warning for each directory and keeps going. It looks like man-db is not written with a situation like ours in mind. >> 2. Add a phase in gnu-build-system.scm that creates a per-package >> database. Change the mandb profile hook such that all it needs to >> do is =E2=80=9Cconcatenate=E2=80=9D all these GDBM databases (which= should be much >> faster than browsing all the man pages as it currently does). > > I like that idea better, but I don't know how feasible it would be. Yeah, dunno. > What is taking so much time anyway? Why is generating this database so > compute intensive? I don't grok why it should be so inefficient to scan > a union'd tree for expected prefixes and append a bunch of file names > together. =E2=80=98mandb-entries=E2=80=99 in (guix man-db) needs to open all the man = pages in the profile, decompress them, and read their header. When there are many man pages, that=E2=80=99s a lot of I/O and CPU usage. One option I contemplated at one point is to simply have fewer man pages in the first place. :-) There were packages that install man pages when they shouldn=E2=80=99t. This led to commits like 305eefc0627eb1d047e6fc4320d7e56897719ab8 and 4b797193d7508ddc53bb1ff7a267a0d50c1fe298 (and parent commits). But even with that, this mandb hook will always get in the way, even though few people use =E2=80=98man -k=E2=80=99. I think we need a better solution to the whole =E2=80=9Csearch for documentation=E2=80=9D problem. Thanks, Ludo=E2=80=99.