On Sun, Feb 12, 2023 at 12:04:38PM +0000, Gavin Smith wrote: > On Sun, Feb 12, 2023 at 11:38:43AM +0000, Gavin Smith wrote: > > I'll try to look at this commit more to see if I can find anything else. > > It's good news: we can keep the uninlined function. The slowdown almost > goes away completely if we eliminate the use of goto statements, e.g.: > > diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm > index 81ca96b3b6..b4765549ef 100644 > --- a/tp/Texinfo/ParserNonXS.pm > +++ b/tp/Texinfo/ParserNonXS.pm > @@ -3921,7 +3921,7 @@ sub _process_remaining_on_line($$$$) > 'extra' => {'arg_line' => $line }}; > $current = $current->{'contents'}->[-1]; > $retval = $GET_A_NEW_LINE; > - goto funexit; > + return ($current, $line, $source_info, $retval); > } elsif ($line =~ /^(\s*?)\@end\s+([a-zA-Z][\w-]*)/ > and ($2 eq $current->{'cmdname'})) { > if ($line =~ s/^(\s+)//) { > > Making this change throughout _process_remaining_on_line reduces the > run time for the manual in question from 45.6 s to 26.8 s.
If you do the change, please keep the 'goto funexit;' in comment to be able to match more easily with the XS parser. -- Pat