[CC trimmed] Hi Colin,
On Sun, Nov 03, 2024 at 12:24:54AM +0000, Colin Watson wrote:
> On Sun, Nov 03, 2024 at 01:05:34AM +0100, Alejandro Colomar wrote:
> > Are you sure? With a small tweak, I get the following comparison:
> >
> > alx@devuan:~/src/linux/man-pages/man-pages/main$ time lexgrog man/*/* |
> > wc
> > lexgrog: can't resolve man7/groff_man.7
> > 12475 99295 919842
>
> Comparing anything to lexgrog isn't very interesting; it's a debugging
> tool and is not in itself very performance-sensitive. As I've explained
> elsewhere, the interesting thing is mandb, which uses the same code
> in-process to scan a whole tree of pages in one go. I do not expect to
> ever want to replace that with a shell pipeline.
I don't know how to compare to mandb(8), since it does other stuff, and
skips some when things haven't changed. In any case, if this is of any
use, you may use it to compare, if you have an idea of what's more or
less the percentage of time that mandb(8) spends on this task:
alx@devuan:~/src/linux/man-pages/man-pages/master$ time mansect NAME man/ | wc
4851 23548 169216
real 0m0.044s
user 0m0.033s
sys 0m0.015s
alx@devuan:~/src/linux/man-pages/man-pages/master$ time mandb man/ |& wc
30 179 2487
real 0m1.341s
user 0m1.065s
sys 0m0.302s
alx@devuan:~/src/linux/man-pages/man-pages/master$ time mandb man/ |& wc
15 80 1116
real 0m0.030s
user 0m0.013s
sys 0m0.008s
This has been run on the Linux man-pages repository, with uncompressed
pages. I've optimized mansect(1) to be 3x faster, and slightly simpler
and more robust, compared to the version posted on the list (and xargs
doesn't need -L1 anymore).
Cheers,
Alex
--
<https://www.alejandro-colomar.es/>
signature.asc
Description: PGP signature
