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

Debounce mathjax rendering to avoid stalling #3827

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iamllama
Copy link
Contributor

@iamllama iamllama commented Feb 17, 2025

Closes #3803

Typing in the mathjax editor causes it to rerender, which can be slow when done per character, given a large enough expression

This pr proposes to debounce rendering to svg by 500ms to avoid stalls

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one minor point:

@@ -25,13 +25,17 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { pageTheme } from "$lib/sveltelib/theme";

import { convertMathjax, unescapeSomeEntities } from "./mathjax";
import { ChangeTimer } from "../editor/change-timer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not a problem at the moment as we have a single compilation unit, this is introducing a circular dependency. change-timer would be better moved to editable or something like sveltelib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implements debouncing in mathjax
2 participants