Skip to content

Performance issues with semantic enrichment #3438

@rossberg

Description

@rossberg

Issue Summary

With semantic enrichment turned on, pages of the WebAssembly spec take 4x the time to render, with up to 10 or 20 s for some users; see issue WebAssembly/spec#1972.

MathJax 4 apparently turns on semantic enrichment by default. Given the performance hit, this should be considered a breaking change, as we had to turn it off manually.

Steps to Reproduce:

  1. Follow the link in Loading instruction reference in a browser takes 10-20 seconds to render WebAssembly/spec#1972 OP.
  2. Manually turn Semantic Enrichment on again through the MathJax context menu — I see the page freeze for approximately 10 s on my machine.

Technical details:

  • MathJax Version: 4.0
  • Client OS: (e.g., Mac OS X 15.6.1)
  • Browser: (e.g., Safari 18.6)
  • Hardware: MacBook Air M2, 16 GB RAM

I am using the following MathJax configuration:

    window.MathJax = {
        "tex": {
            "maxBuffer": 30720,
            "macros": {
                "multicolumn": ["", 2]
            }
        },
        "options": {
            "menuOptions": {
                "settings": {
                    "enrich": false
                }
            }
        }
    }

and loading MathJax via

    <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js"></script>

Supporting information:

  • For live link please see above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions