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

Extremely slow build speed. #30

Open
AleksandrHovhannisyan opened this issue Dec 10, 2019 · 5 comments
Open

Extremely slow build speed. #30

AleksandrHovhannisyan opened this issue Dec 10, 2019 · 5 comments

Comments

@AleksandrHovhannisyan
Copy link

As much as I'd like to use this plugin, as it performs much better than Mathjax, it's unbearably slow. What used to take 4-7 seconds to generate the feed for posts is now taking 40+ seconds:

image

@hugmanrique
Copy link

hugmanrique commented Apr 14, 2020

I went from posts rendering in 0.93 seconds to 5.2+ seconds. Is it possible to integrate the new Jekyll cache with this plugin?

@AleksandrHovhannisyan
Copy link
Author

@hugmanrique What I ended up doing is following this tutorial instead of using the plugin:

https://xuc.me/blog/katex-and-jekyll/

This worked for me and didn't slow down the build speed at all (since it's loading and parsing KaTeX in real time when the page loads).

My recommendation is to conditionally include the scripts for KaTeX and jQuery in your post.html layout file (or whatever you've named it) using some kind of front matter variable in your posts (e.g., needsLatex).

@hugmanrique
Copy link

hugmanrique commented Apr 14, 2020

My site doesn't require any JS to read. I prefer 5 seconds of compile-time rather than rendering math at runtime (sending every client 250 kB + wasting time on their CPU).

This is the beauty of this plugin.

@AleksandrHovhannisyan
Copy link
Author

I prefer 5 seconds of compile-time rather than rendering math at runtime

You are, of course, free to do whatever you want with your own site 🙂

But...

I went from posts rendering in 0.93 seconds to 5.2+ seconds.

I thought you were upset that your build time increased, so I mentioned an alternative solution that happened to work for me.

It's also a potential solution for anyone who's deploying to GitHub Pages since the plugin isn't supported.

@Jaxan
Copy link

Jaxan commented Feb 16, 2021

To add to this discussion, kramdown now supports KaTeX as math output and it doesn't require javascript. See #35, building my website went from 20s to 1.5s using their approach.

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

No branches or pull requests

3 participants