-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Highlight.js is slow #1036
Comments
From my point of view, it is worthwhile sacrificing some loading time for a quicker open in browser. |
Actually it's fast to do highlight on browsers, since browsers only need to render a page at a time and Hexo has to render hundreds of pages in a few seconds. It takes lots of CPU time to do this. |
OK, I will support your idea. Since I use Travis CI to do this, so I'm not care about the time highlight.js used, hahaha |
Is there any other lib which has high performance than highlight.js on rendering pages? |
I mean rendering pages in command line, not in browsers. |
@iissnan Maybe we can give highlights a try. It's used by atom. |
@tommy351 Executed a simple performance test with hexo-util and highlights.
LGTM. |
By the way, if this change has effect on theme highlight styles? |
The styles may need changes if we change the library. |
Sorry for the incorrect testing. |
Thanks for the testing. I'll try to optimize that function. |
I just made a benchmark and this is the result:
There's no large differences between them. Here's the source code: https://gist.github.com/tommy351/48401ae93dbf6aa2e94d |
And this is the test for highlights.
P.S. highlights detects languages automatically. |
WOW, it's sound like highlights is good. |
I tell the md the tab text what it is,like bash ,like raw ,the highlight make it so fast |
Any plan to move to highlights? Also see #1543. |
Remove highlight.js may need to update the stylesheet of all curernt themes. |
@hexojs/core What do you think of atom highlights? feasible? |
Highlight.js is slow. After turning off the highlighting, the loading speed dropped from 46s to 16s. Maybe we should change another highlighting library or use SyntaxHighlighter or Prism to let browsers do this job.
The text was updated successfully, but these errors were encountered: