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

Consider to speed up the generating process #661

Closed
4 of 8 tasks
Liam0205 opened this issue Mar 7, 2019 · 10 comments · Fixed by #954
Closed
4 of 8 tasks

Consider to speed up the generating process #661

Liam0205 opened this issue Mar 7, 2019 · 10 comments · Fixed by #954

Comments

@Liam0205
Copy link
Contributor

Liam0205 commented Mar 7, 2019

I agree and want to create new issue


Expected behavior

When I was using old version of NexT (0.x), generating 250+ posts costs around 1.4 minutes. I consider this is the expected behavior of Hexo generating speed.

Actual behavior

Now, generating 280 posts cost more than 7 minutes, and one day it costs me 20 minutes, which is not considered to be tolerated.

Steps to reproduce the behavior

$ hexo clean && time hexo generate
  • Link to demo site with this feature: N/A
  • Link(s) to source code or any usefull link(s): N/A

What I've tried

Here are what I've tried:

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces
  • Gemini

Hexo's and NexT's version number, configuration of Hexo and NexT, and environment information could be found in #658 .

@Liam0205
Copy link
Contributor Author

Liam0205 commented Mar 7, 2019

Test for cache-disabled. disable_cache.log

$ hexo clean && time hexo generate > disable_cache.log 2>&1
INFO  Deleted database.
INFO  Deleted public folder.

real    10m40.752s
user    0m0.030s
sys     0m0.291s

Test for cache-enabled. (didn't get the announced 3x speed-up.)
enable_cache.log

$ hexo clean && time hexo generate > enable_cache.log 2>&1
INFO  Deleted database.
INFO  Deleted public folder.

real    7m58.032s
user    0m0.031s
sys     0m0.306s

@jiangtj
Copy link
Member

jiangtj commented Mar 7, 2019

Same issue in all schemes.
See https://hexo.io/docs/templates.html#Optimization.
Fragment Caching may be a good way, but it takes a lot of work.

@Liam0205
Copy link
Contributor Author

Liam0205 commented Mar 7, 2019

Same issue in all schemes.

Scheme or theme? Is this a NexT specific problem? --- based on #539 , it seems to be.

See https://hexo.io/docs/templates.html#Optimization.
Fragment Caching may be a good way, but it takes a lot of work.

Do your team has a plan for this?

@ivan-nginx
Copy link
Member

ivan-nginx commented Mar 7, 2019

@Liam0205 issue will be fixed soon. I've already turnkey solution, need just to debug it.

@Liam0205
Copy link
Contributor Author

@ivan-nginx Glad to know!

If there is any progress of it, or if any test task needed, please let me know.

@jiangtj
Copy link
Member

jiangtj commented Apr 16, 2019

I think use partial helper instead of include swig tag may be improved to some extent.

partial read data from theme.views object.
https://github.com/hexojs/hexo/blob/a6dc0ea28dddad1b5f1bad7c6f86f1e0627b564a/lib/plugins/helper/partial.js#L12

include read from disk file.
image
https://github.com/node-swig/swig-templates/blob/6209307105f609a54bdbbee4ca0cc156991a521c/lib/tags/include.js#L39-L51

@jiangtj
Copy link
Member

jiangtj commented Jul 12, 2019

#969 I don't have any ideas now. . .

@jiangtj jiangtj reopened this Jul 12, 2019
@stevenjoezhang
Copy link
Contributor

stevenjoezhang commented Jul 12, 2019

So... how do
https://github.com/hexojs/hexo-generator-tag
and
https://github.com/hexojs/hexo-generator-category
deal with _draft 😥

#42 #87

GitHub
Tag generator plugin for Hexo. Contribute to hexojs/hexo-generator-tag development by creating an account on GitHub.
GitHub
Category generator plugin for Hexo. Contribute to hexojs/hexo-generator-category development by creating an account on GitHub.

@jiangtj
Copy link
Member

jiangtj commented Jul 12, 2019

https://github.com/hexojs/hexo/blob/b6394c78751d2be81c3fd7c243fca37c552cd83a/lib/plugins/helper/tagcloud.js#L196

Same, filter. We only used it in one place....

GitHub
A fast, simple & powerful blog framework, powered by Node.js. - hexojs/hexo

@jiangtj
Copy link
Member

jiangtj commented Jul 12, 2019

https://github.com/hexojs/hexo-theme-landscape/blob/7e0bd67ddf5d41d161437e2343da5d45c076a072/layout/layout.ejs#L11

Cache...

GitHub
A brand new default theme for Hexo. Contribute to hexojs/hexo-theme-landscape development by creating an account on GitHub.

@Liam0205
Copy link
Contributor Author

After #971 being merged, the generating speed is much faster than before.

My great appreciation would be shown to @jiangtj and the team for the continuous efforts on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants