The Math extension has a mechanism that causes that math tags on wiki pages are not parsed sequentially but in micro-batches. With the current batch size of 150, this causes a significant speedup in rendering pages with multiple math expressions. (Speedup for math-heavy pages, e.g., in Wikiversity, from about 10 minutes to about 1min.)
The downside of the approach - It is currently a hack -
- It uses a static variable to collect all math tags
- then it replaces math tags with strip markers,
- there are different implementations that either pass tags at once to a mathoid command-line client or post the requests in micro-batches to a restbase server using HTTP-multi client implementations (currently guzzle).
- uses the parserAfterTidy hook to insert the actual rendering. (See also T103269)
As we are updating the math extension code in preparation to update to MathJax 3 (See T237516) I was thinking if that might be an option to find a better solution that must not live in the Math extension and can be integrated to the core, since the current mechanism can not be maintained by the math community in the long run.
Any ideas on how to proceed here?