Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance degradation in Preview mode due to lengthy code syntax highlighting #321

Open
devleejb opened this issue Aug 27, 2024 · 1 comment
Labels
bug 🐞 Something isn't working

Comments

@devleejb
Copy link
Member

Description:

When working with lengthy code blocks, the Preview performance degrades significantly when syntax highlighting is applied. This occurs in both edit and preview modes during typing, causing delays with text, code, and equations. However, typing in edit mode does not exhibit this lag. Removing all equations (by deleting $ characters) does not resolve the issue, but removing all code (by deleting backtick characters) does eliminate the lag.

It appears that the performance issues may be related to the size of the DOM tree due to the creation of multiple DOM elements for each keyword in the code syntax highlighting functionality.

Why:

To maintain a smooth user experience, especially when interacting with lengthy code blocks during the Preview mode.

Reference:
https://web.dev/articles/dom-size-and-interactivity

@devleejb
Copy link
Member Author

Related to #393.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
Status: Backlog
Status: Backlog
Development

No branches or pull requests

1 participant