> From: Gavin Smith <gavinsmith0...@gmail.com> > Date: Sun, 22 Oct 2023 13:35:19 +0100 > Cc: bug-texinfo@gnu.org > > On Sun, Oct 22, 2023 at 12:06:21PM +0300, Eli Zaretskii wrote: > > . makeinfo is painfully slow. For example, building the ELisp > > manual that is part of Emacs takes a whopping 82.3 sec. By > > contrast, Texinfo-7.0.3 takes just 20.7 sec. And this is with > > Perl extensions being used! What could explain such a performance > > regression? perhaps the use of libunistring or some other code > > that handles non-ASCII characters? > > It could be the use of Unicode collation for sorting document indices.
Can index sorting take more than a 1 minute? > First, check that the Perl extension modules are actually being used. Try > setting the TEXINFO_XS environment variable to "require" or "debug". I don't need to do that, I already verified that extensions are used when I worked on the pretests (which, as you might remember, caused Perl to crash at first). > Otherwise, the easiest way of turning off the Unicode collation is > patching the source code: > > --- a/tp/Texinfo/Structuring.pm > +++ b/tp/Texinfo/Structuring.pm > @@ -2604,7 +2604,7 @@ sub setup_sortable_index_entries($$$$$;$) > my $collator; > eval { require Unicode::Collate; Unicode::Collate->import; }; > my $unicode_collate_loading_error = $@; > - if ($unicode_collate_loading_error eq '') { > + if (0 || $unicode_collate_loading_error eq '') { > $collator = Unicode::Collate->new(%collate_options); > } else { > $collator = Texinfo::CollateStub->new(); > > This should use the 'cmp' Perl operator instead of the more complicated > Unicode collation algorithm. How can I run makeinfo uninstalled, from the texinfo-7.1 source tree? The version that is currently installed here is v7.0.3, as I must be able to produce manuals in reasonable times as part of my work on Emacs and other projects, so I uninstalled 7.1 when I found these problems. > (Incidently 20.7 seconds for Texinfo 7.0.3 is still longer than I would > expect. On my system the same manual is processed in 5-6 seconds, on > GNU/Linux on a fairly cheap Acer laptop.) That is of secondary importance for me at this time.