Re: Accessibility of man pages

Eli Zaretskii <eliz-mXXj517/[email protected]>
Newsgroups gmane.linux.man,gmane.comp.tex.texinfo.general,gmane.comp.printing.groff.general
Message-ID <[email protected]>
> From: Dirk Gouders <[email protected]>
> Cc: Colin Watson <[email protected]>, Eli Zaretskii <eliz-mXXj517/[email protected]>,
>         [email protected], help-texinfo-mXXj517/[email protected],
>         [email protected], [email protected],
>         groff-mXXj517/[email protected]
> Date: Sat, 08 Apr 2023 21:48:13 +0200
> 
> $ find /usr/share/man -type f -exec bzgrep -l RLIMIT_NOFILE {} \;
> /usr/share/man/man1/runuser.1.bz2
> /usr/share/man/man1/su.1.bz2
> /usr/share/man/man1/nghttpx.1.bz2
> /usr/share/man/man3/getdtablesize.3.bz2
> /usr/share/man/man3/mq_open.3.bz2
> /usr/share/man/man3/errno.3.bz2
> /usr/share/man/man3/sysconf.3.bz2
> /usr/share/man/man3p/getrlimit.3p.bz2
> /usr/share/man/man3p/sysconf.3p.bz2
> /usr/share/man/man3p/posix_spawn_file_actions_addclose.3p.bz2
> /usr/share/man/man0p/sys_resource.h.0p.bz2
> /usr/share/man/man2/pidfd_open.2.bz2
> /usr/share/man/man2/poll.2.bz2
> /usr/share/man/man2/getrlimit.2.bz2
> /usr/share/man/man2/open.2.bz2
> /usr/share/man/man2/select.2.bz2
> /usr/share/man/man2/fcntl.2.bz2
> /usr/share/man/man2/seccomp_unotify.2.bz2
> /usr/share/man/man2/dup.2.bz2
> /usr/share/man/man2/pidfd_getfd.2.bz2
> /usr/share/man/man7/fanotify.7.bz2
> /usr/share/man/man7/capabilities.7.bz2
> /usr/share/man/man7/unix.7.bz2
> /usr/share/man/man5/proc.5.bz2
> 
> Yes, it's very slow but close to `man -K`:
> 
> find...             man -K...
> 
> real 107.45         real 96.34
> user 117.06         user 70.11
> sys 14.43           sys 26.86
> 
> [a thought later]
> 
> Oh, I found something much faster:
> 
> $ time -p find /usr/share/man -type f | xargs bzgrep -l RLIMIT_NOFILE
> [snip]
> 
> real 24.30
> user 32.34
> sys 6.84
> 
> Hmm, perhaps, someone has an explanation for this?

Multiprocessing, obviously.  Your CPU has more than one execution
unit, so the pipe via xargs runs 'find' and 'bzgrep' in parallel on
two different execution units.  By contrast, "find -exec" runs them
sequentially, in a single thread.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.