Comments (9)
@Atif-Sheikh
As mentioned in comment #2579, almost certainly your environment will be speed improvement by deleting db.json
before running hexo g
or hexo s
, as suggested if you're not using the id for persistence purposes.
Of course, these times will be influenced by machine specs, the theme you're using, and the plugins, but there's no doubt it speeds up the process.
There are no official Hexo plugins that use ids
for persistence purposes, but we don't know about third-party plugins.
In fact, I've been deleting db.json
before running hexo g
and hexo s
for quite some time, and it's quite effective. In my current environment, I have 1800 .md
files and 1500 image files (jpg, png), and db.json
is 37MB. Without deleting db.json
, hexo g
takes about 8 minutes to complete, but with it deleted, it finishes in less than a minute.
from hexo.
@Atif-Sheikh I found that the hexo-related-posts
plugin accounts for nearly 30% of the processing time. You could try disabling this plugin first.
from hexo.
Additionally, the hexo-asset-pipeline
also occupies a significant amount of processing time. This plugin has actually been deprecated by the Hexo team since 2022: https://github.com/hexojs/hexo-asset-pipeline. If you need to compress HTML files, I recommend using the hexo-optimize plugin, which uses a Rust-based HTML compression library for better performance. For image compression, you may need to look for other tools as alternatives.
from hexo.
Currently, we are aware that in some cases, Hexo generation can be very slow: #2579 #4309
To answer your question, we need more information, such as whether your blog has a lot of articles or images?
from hexo.
Currently, we are aware that in some cases, Hexo generation can be very slow: #2579 #4309 To answer your question, we need more information, such as whether your blog has a lot of articles or images?
@stevenjoezhang We have around 600+ articles and yes every article has images as well.
from hexo.
@stevenjoezhang Can we expect the fix from the Hexo ASAP as most of the users are struggling with this issue?
from hexo.
Did you encounter this problem after upgrading your Hexo version? As far as I know, slowdowns in generation time are not common, so I can't pinpoint the exact cause of this issue, nor do we know how to optimize it.
If possible, you can help us by conducting an experiment: run the command
npm i -g 0x
0x node_modules/.bin/hexo g
This command will generate an HTML file (flamegraph), and we can use this information to identify where the performance bottleneck is.
from hexo.
Did you encounter this problem after upgrading your Hexo version? As far as I know, slowdowns in generation time are not common, so I can't pinpoint the exact cause of this issue, nor do we know how to optimize it. If possible, you can help us by conducting an experiment: run the command
npm i -g 0x 0x node_modules/.bin/hexo gThis command will generate an HTML file (flamegraph), and we can use this information to identify where the performance bottleneck is.
@stevenjoezhang Here is the flamegraph
file, Please take a look at it and yes I'm using the latest Hexo version.
from hexo.
Additionally, the
hexo-asset-pipeline
also occupies a significant amount of processing time. This plugin has actually been deprecated by the Hexo team since 2022: https://github.com/hexojs/hexo-asset-pipeline. If you need to compress HTML files, I recommend using the hexo-optimize plugin, which uses a Rust-based HTML compression library for better performance. For image compression, you may need to look for other tools as alternatives.
@stevenjoezhang Thanks for spending time on this issue, I'll try the changes you suggested and will get back to you.
from hexo.
Related Issues (20)
- "post_link" tag doesn't work HOT 2
- Code blocks in HTML comments were incorrectly converted HOT 2
- hexo g is truncated by {# HOT 2
- 编译后,发布时多了一个不存在的空文件 HOT 4
- md生成的文件如果不带.html扩展名,会导致nginx中的mine.types文件配置无法匹配,会默认default_type,自有服务器可以更改成text/html,但是如果发布到github pages里面就会出现刷新页面,下载该页面的
- why themes folder is empty? 为何 themes 文件夹下没有文件? HOT 1
- [FEATURE REQUEST] sort the tags and categories by alphabet
- Hexo install with pnpm report errors, but yarn not. HOT 1
- 页面全部变成黑白的,毫无预兆的,图片或者按钮或者装饰,整个页面变成黑白的。但是各个组件都正常工作 HOT 1
- Add `:path` as a valid permalink component? HOT 1
- Theme apply process optimization HOT 1
- hexo 7.2: Error: Cannot find module 'hexo-util/dist/spawn' HOT 1
- .j2 file in code_dir causing rendering error HOT 5
- `include_code` tag is broken in Hexo 7.2.0 HOT 3
- Can't find theme when deploying hexo on github pages HOT 4
- [Bug 🐛] Table not shown when inside a quote HOT 5
- :name parameter in permalink cannot work as expected. HOT 2
- Remove bluebird HOT 1
- > Error: Spawn failed at ChildProcess. (/data/data/com.termux/files/home/blog/node_modules/hexo-util/lib/spawn.js:51:21) at ChildProcess.emit (node:events:513:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) emm不知道为什么
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo.