On Sun, Oct 29, 2023 at 03:18:14PM +0100, Patrice Dumas wrote: > In commit > https://git.savannah.gnu.org/cgit/texinfo.git/commit/?id=7f1b750038f13a58bbd513a6f2f07dda5e87ad3f > I have modified the code such that with XS the first document built > out of the parser is a minimal document, without indices/tree, only > information allowing following XS code to find C data, information > on errors and some document information (adding novalidate and > documentlanguage), as there is no perl code needing that information in > the default XS case. The document/tree usable in perl is obtained by > the Texinfo::Structuring::rebuild_document call.
This seems like what was needed - building information on demand. It appears to have sped up processing significantly and appears to have reversed most of if not all of the slowdown. This is a relief - thanks for working on this. I would like to test it more and understand if further optimisations are possible and understand the changes better but have limited time at the moment to work on this - hopefully I'll get to it soon. I don't think that the removal of 'simple_parser' should be significant for XS; it was a simple synonym for 'parser' in the XS code. I remember that using 'simple_parser' was one of the first optimisations we made to texi2any (from 5.2 onwards) and it made a very significant difference, but it appears this would only be for non-XS processing.