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

Slow rendering of KaTeX on W10 with global definitions #3993

Closed
CalebUsadi opened this issue Oct 28, 2020 · 3 comments
Closed

Slow rendering of KaTeX on W10 with global definitions #3993

CalebUsadi opened this issue Oct 28, 2020 · 3 comments
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@CalebUsadi
Copy link

This issue is very similar to this one. When rendering a file with a large number of equations and a significant number of \gdef commands, Joplin freezes while any new change renders, which occurs very slowly. I show the example similarly to how it's done in the example in the issue linked, here.

example.zip
example

Environment

Joplin version: 1.26 (prod, win32)
Platform: Windows
OS specifics: Version 10.0.18362 Build 18362

Steps to reproduce

  1. Open note with a significant amount of KaTeX
  2. Experience slow render time
  3. Make any edits to the file
  4. Experience lag when updating render

Describe what you expected to happen

Expect fast render time and fast updating.

Logfile

log.txt
console.txt

I don't really see any major issues in either file. There is that one final KaTeX error, but I find it hard to believe that that's the biggest issue. I wonder if it may also be because I have a lot of large files already saved in Joplin.

@CalebUsadi CalebUsadi added the bug It's a bug label Oct 28, 2020
@laurent22 laurent22 added desktop All desktop platforms high High priority issues labels Oct 28, 2020
@laurent22
Copy link
Owner

Please could you provide a sample note that shows this issue?

@CalebUsadi
Copy link
Author

example.zip

This is the same file as the one linked above as well as in the gif, GitHub wouldn't let me upload just a .jex file.

@laurent22
Copy link
Owner

Katex saves the macros in a very complex structure which was slow to cache, so I've added bespoke code just to cache this, which should improve performance. You have some errors in your file though, and currently it means you will incur a cache miss every time the note is re-rendered. You can find the errors simply by checking the Katex code that appears as non rendered, or in the console (Help menu, Dev tools).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants