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

refactor: use rfdc to replace lodash #65

Merged
merged 2 commits into from
Nov 4, 2019
Merged

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Oct 31, 2019

https://www.npmjs.com/package/rfdc

According to the benchmark performed by rfdc. it is at least 3x more faster than lodash cloneDeep.

@SukkaW
Copy link
Member Author

SukkaW commented Oct 31, 2019

A benchmark using a hexo dummy website (with 300 posts):

Node.js 8

Cold Process Cold Save DB Hot Process Memory (Cold) Memory (Hot)
Current Master Branch 22.83s 0.79s 16.86s 528MB 519.3MB
This PR 22.26s 0.66s 16.42s 402.8MB 524MB

Nodejs.10

Cold Process Cold Save DB Hot Process Memory (Cold) Memory (Hot)
Current Master Branch 21.69s 0.631s 15.20s 513.7MB 488.3MB
This PR 21.30s 0.627s 17.11s 418MB 400.1MB

Nodejs.12

Cold Process Cold Save DB Hot Process Memory (Cold) Memory (Hot)
Current Master Branch 19.81s 0.481s 15.13s 437.4MB 477.7MB
This PR 20.02s 0.451s 14.74s 433.4MB 476MB

The speed is more or less the same (Maybe a little bit faster) while memory usage drops significantly on Nodejs 8 & 10.

Copy link
Contributor

@segayuu segayuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SukkaW SukkaW merged commit 2170bf4 into hexojs:master Nov 4, 2019
@SukkaW SukkaW mentioned this pull request Jan 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants