all messages for Guix-related lists mirrored at yhetil.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>, myglc2 <myglc2@gmail.com>
Subject: Re: Performance of the man page database generation
Date: Tue, 16 May 2017 10:24:45 -0700	[thread overview]
Message-ID: <87tw4kzpcy.fsf@gmail.com> (raw)
In-Reply-To: <87tw4lb4am.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 16 May 2017 10:21:21 +0200")

[-- Attachment #1: Type: text/plain, Size: 3485 bytes --]

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> 18 man subdirectories contained newer manual pages.
>> 3943 manual pages were added.
>> find-files: /gnu/store/5mk4lg1rdzq2p3148idjd4z0bvif0nf4-gimp-2.8.18/share/man/man1/gimp-console.1: No such file or directory
>> guix build: error: build failed: derivation
>> `/gnu/store/vk10zmd5nm8kppd0f655fraradr019fq-manual-database.drv'
>> may not be deterministic: output
>> `/gnu/store/lmf9rfzj565m31xzhhlam3lk91bjbqsm-manual-database'
>> differs
>>
>> real    0m39.890s
>> user    0m0.356s
>> sys     0m0.040s
>
> Not good!
>
>> As you can see, mandb stumbled more than once with some of our packages'
>> manpages. Those failures are probably attributable to bad packages
>> manual pages. For example, the gcc manual pages are known to be broken
>> for example. [0]
>>
>> By looking at the output as it was generated, it seemed as if those
>> failures caused mandb to take more time.
>
> That would be surprising no?
>

You're right. The output just tricked me into thinking that. But in the
end it's just the sheer numbers of manpages in my profile which takes
time to get indexed (I have almost 4000). The package which the biggest
collection that I know of is 'libx11', which comes with more than 2000
packages itself!

It can be used as a good test for the manual database profile hook:

--8<---------------cut here---------------start------------->8---
guix environment --ad-hoc libx11
substitute: updating list of substitutes from 'https://bayfront.guixsd.org'... 100.0%
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/1ysz4v6nn4iwpwisgpzb3x92isympxrq-profile.drv
   /gnu/store/4laycbr82asv7k4li1y1fwfgfjfp0qxz-manual-database.drv
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
Creating manual page database for 5 packages... done in 20.124 s
--8<---------------cut here---------------start------------->8---

>> Another reason could be that mandb is just inefficient. There's an old
>> bug about mandb's use of processes being less than optimal ("strace
>> indicates that mandb is forking on the order of four processes per
>> page") [1]. It seems that Colin Watson had a good idea of how to improve
>> things but didn't get around to implementing it yet.
>
> Yeah, I noticed that it was forking a lot by looking at the process
> graph in gkrellm.  That’s not good.
>
> The database creation is probably not rocket science, so I wonder if we
> could implement it more efficiently in Guile using the appropriate gdbm
> or bdb bindings.  Certainly we could avoid the forks.
>
> Alternately we optimize mandb itself directly and contribute it
> upstream, which would be benefit everyone but might be trickier.
>
> Thoughts?

It'd be nice as a first to check with Colin if he still thinks fixing it
in mandb would be easy. Colin pointed to improving the pipeline with
coroutines or generators [0], which would potentially go in
"libpipeline".

If this stuff is not easy to implement there, then yes, an
implementation in Guile with bindings to gdbm (which is what we are
using currently) would make sense since Guile already comes which
coroutines and generators, IIUC.

Maxim

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630799

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      reply	other threads:[~2017-05-16 17:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170405205638.12336.78854@vcs0.savannah.gnu.org>
     [not found] ` <20170405205640.15AE6210A4@vcs0.savannah.gnu.org>
2017-04-08 19:29   ` 04/06: profiles: Generate database file for man pages Leo Famulari
2017-04-10  1:00     ` Maxim Cournoyer
2017-04-09 17:28   ` myglc2
2017-04-10  1:22     ` Maxim Cournoyer
2017-04-10  1:45       ` myglc2
2017-04-15  0:25         ` Maxim Cournoyer
2017-04-20  9:29           ` Performance of the man page database generation Ludovic Courtès
2017-05-14  6:18             ` Maxim Cournoyer
2017-05-14 15:31               ` myglc2
2017-05-15 16:23                 ` bug#26942: [PATCH] Add Add elapsed time to manual-database hook to output message (was: Performance of the man page database generation) Maxim Cournoyer
2017-05-16 21:12                   ` bug#26942: [PATCH] Add Add elapsed time to manual-database hook to output message Ludovic Courtès
2017-05-30 21:29                     ` Ricardo Wurmus
2017-05-16  8:21               ` Performance of the man page database generation Ludovic Courtès
2017-05-16 17:24                 ` Maxim Cournoyer [this message]

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

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

  git send-email \
    --in-reply-to=87tw4kzpcy.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=myglc2@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.