tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Wesley Moore <wes@wezm.net>
To: tech@mandoc.bsd.lv
Subject: Improve performance of makewhatis
Date: Mon, 13 Nov 2023 11:42:42 +1000	[thread overview]
Message-ID: <20231113014330.2247710-1-wes@wezm.net> (raw)

Hello,

In this patch set I aimed to improve the performance of makewhatis. On
my Chimera Linux systems makewhatis -Tutf8 is run to rebuild the index
whenever a package containing man pages is installed or updated. I
noticed this took multiple seconds even on a Ryzen 9 7950X system.

Profiling showed a lot of time spent in the loops of roff_getstrn. To
speed this up I made use of hash tables. I tested the changes on several
different systems:

- OpenBSD amd64 in VM
- Linux on Raspberry Pi 4
- Linux on Ryzen 9 7950X

In each case the wall clock run time for makewhatis -Tutf8 -n showed an
reduction of between 25% and 35%.

The one caveat of this change is the roff/while/into regression test is
failing with my changes. I've tried to work out why but I don't know
roff well enough understand the intent of the test nor have I been able
to clearly determine why my changes affect it. I was hoping to get some
help with this.

Regards,
Wes


--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


             reply	other threads:[~2023-11-13  1:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  1:42 Wesley Moore [this message]
2023-11-13  1:42 ` [PATCH 1/3] Use ohash for strtab Wesley Moore
2023-11-13  1:42 ` [PATCH 2/3] Use ohash for rentab Wesley Moore
2023-11-13  1:42 ` [PATCH 3/3] Use ohash for predefined strings Wesley Moore
2023-11-15  1:26 ` Improve performance of makewhatis Ingo Schwarze
2023-11-15  8:29   ` Wesley Moore
2023-11-15 17:36     ` Ingo Schwarze

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=20231113014330.2247710-1-wes@wezm.net \
    --to=wes@wezm.net \
    --cc=tech@mandoc.bsd.lv \
    /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.
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 NNTP newsgroup(s).