-
-
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
hexo 3.0 file loading speed #1124
Comments
Wow, It's different for me that Hexo generent faster than 2.8.3 |
It took me more than one hour to launch the server and render the whole site with 168 files after I upgrade to Hexo 3.0. |
It could be your theme, assuming you are not using the default landscape theme. If you are using the landscape theme,I'd suggest it's either a plugin or something in your content that is tripping up the parsers. Or it could be an old version of node.js |
Are you using It really seems to slowdown the server startup, even with only a couple of source files. |
Hi @jr0cket , @celsomiranda After profiling I found it's such kind of code that become the bottleneck of loading speed:
It works fine under Hexo 2.x but not under 3.0. So maybe the Highlight.js is to be blamed? You can test the above code under your environment and see whether you come across the same problem. |
@wzpan Maybe you're right. Highlight.js is super slow when it's trying to detect languages automatically. You can try to specify the language of code block to
|
Yup that's a good scenario. Solved it. Thanks @tommy351 . |
Ref #1036 |
Thank you for everyone. |
Using 'plain' can help improve file load performance. I've verified this. My blog has 5 posts. The original load time is 5.39s and it becomes 4.5s after add "plain" for code blocks. However, It seems that it still need to be optimized |
@kiwenlau In Hexo 3.1, you can disable auto detect for highlight. highlight:
auto_detect: false |
FYI, I wrote a script to help me detect all the plain codes without Remember to backup your posts before executing this script, since it will do the job in-place. Script address: https://gist.github.com/wzpan/7db9b0888f06a8d6ff8c |
@tommy351 I've disabled auto detect for highlight, but it can not improve file load time, which is 4.57s(the load time is 4.5s with auto detect). I think there will be some other reasons for this. FYI. Following is the output of "hexo version"
|
@tommy351 The _config.yml file in the theme's(mine is Next) directory or the main site directory ? FATAL duplicated mapping key at line 111, column 1: |
Hi, my hexo was migrated from 2.8 to 3.0 recently, but the speed of file loading was extremely slow.
hexo: 2.8.3
[info] Files loaded in 0.914s
[info] 102 files generated in 1.527s
hexo: 3.0.0
INFO Files loaded in 2.45 min
INFO 101 files generatd in 2.97 s
Can someone help me?
The text was updated successfully, but these errors were encountered: