public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Deri <deri@chuzzlewit.myzen.co.uk>
Cc: linux-man@vger.kernel.org, groff@gnu.org
Subject: Re: Optimize script for generating LinuxManBook.pdf
Date: Thu, 23 Nov 2023 23:12:45 +0100	[thread overview]
Message-ID: <ZV_OXhw7V6Vk1HBR@debian> (raw)
In-Reply-To: <2818350.Jt13fLt2Sg@pip>

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

Hi Deri,

On Thu, Nov 23, 2023 at 06:41:14PM +0000, Deri wrote:
> Hi Alex,
> 
> It looks fine, although you have to run the code in 
> "prepare_linux_man_book.pl" twice (to avoid using a temporary file).

Yep.  I was wondering if we could change something in the design of
prepare_linux_man_book.pl so that it could be run once without needing
a temporary file.  Maybe if it could insert something in the pages that
the latter troff(1) would process in one take, without having to put all
the bookmarks at the start of the file.  That would be an important
simplification of the scripts, and probably also an optimization.

> If you 
> are going to run preconv it is best to run it first - stops pic spitting out 
> loads of warnings.

Thanks!  Makes sense.

> You also dropped one stage in second pass, no pic in the 
> pipeline. This may explain part of the speedup you observed. I don't know if 
> any of your man pages require pic but they could in the future. The changes I 
> would advise are:-

Thanks!  I've applied those changes; will push in a moment.  The speedup
is still the same; probably because pic(1)'s throughput is faster than
the consumers of its output, and its latency is negligible.  Since it
doesn't slow down, I've added it, just in case we want to use pic(1) in
some page in the future, as you say.

Cheers,
Alex

> 
> --- a/scripts/LinuxManBook/build_linux_man_book.sh
> +++ b/scripts/LinuxManBook/build_linux_man_book.sh
> @@ -4,8 +4,8 @@
>  
>  (
>         "$(dirname "$0")"/prepare_linux_man_book.pl "$1" \
> -       | pic \
>         | preconv \
> +       | pic \
>         | tbl \
>         | eqn -Tpdf \
>         | troff -Tpdf -dPDF.EXPORT=1 -dLABEL.REFS=1 -dpaper=a4 \
> @@ -16,6 +16,7 @@
>         "$(dirname "$0")"/prepare_linux_man_book.pl "$1";
>  ) \
>  | preconv \
> +| pic \
>  | tbl \
>  | eqn -Tpdf \
>  | (
> 
> Cheers
> 
> Deri
> 
> 
> 
> 

-- 
<https://www.alejandro-colomar.es/>

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

  reply	other threads:[~2023-11-23 22:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 14:58 Optimize script for generating LinuxManBook.pdf Alejandro Colomar
2023-11-22 17:33 ` Deri
2023-11-22 17:39   ` Alejandro Colomar
2023-11-23 18:41 ` Deri
2023-11-23 22:12   ` Alejandro Colomar [this message]
2023-11-24 11:46     ` Alejandro Colomar
2023-11-30 16:56       ` Deri
2023-11-30 22:38         ` Alejandro Colomar
2023-12-01  0:14           ` Alejandro Colomar
2023-12-01  0:37             ` Alejandro Colomar

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=ZV_OXhw7V6Vk1HBR@debian \
    --to=alx@kernel.org \
    --cc=deri@chuzzlewit.myzen.co.uk \
    --cc=groff@gnu.org \
    --cc=linux-man@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox