unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Getting rid of the mandb profile hook?
Date: Sat, 27 Feb 2021 08:05:22 -0500	[thread overview]
Message-ID: <87v9ad7jal.fsf@gmail.com> (raw)
In-Reply-To: <87k0tw3y15.fsf@inria.fr> ("Ludovic Courtès"'s message of "Sat, 05 Dec 2020 19:31:18 +0100")

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Guix!
>
> I was inspired by Michael Stapelberg’s talk recently shared on IRC¹
> (well worth watching!).  One of the takeaways for me is that many
> actions should be done lazily, in particular populating caches.
>
> ‘guix install’ & co. spend a significant time populating such caches, in
> particular the XDG caches² and the manual page database (mandb).
>
> I’m 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 ‘man’ wrapper or modify the ‘man-db’ package such that
>      the database gets built on the first use of ‘man -k’, unless it’s
>      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.

>   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 “concatenate” 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.

> There are crazier option that came to mind but let’s ignore them for
> now.

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.

> Thoughts?  :-)

Lazily doing things seems a good idea in general to make the experience
more snappy.  Thanks for looking into it!

Maxim


  parent reply	other threads:[~2021-02-27 13:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05 18:31 Getting rid of the mandb profile hook? Ludovic Courtès
2020-12-05 18:51 ` Pierre Neidhardt
2020-12-05 20:18 ` Ryan Prior
2020-12-06  0:37 ` Ricardo Wurmus
2020-12-08 10:47   ` Ludovic Courtès
2021-02-27 13:05 ` Maxim Cournoyer [this message]
2021-03-03 14:13   ` Ludovic Courtès
2021-03-03 20:50     ` Brice Waegeneire
2021-03-10 10:20       ` Ludovic Courtès
2021-04-02 16:56       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9ad7jal.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).