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: drop lodash for lib/hexo/index.js #3845

Merged
merged 2 commits into from
Nov 30, 2019

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Nov 8, 2019

What does it do?

This PR is part of #3753

This PR only replace cloneDeep and debounce with native while lodash itself retains exposed to global.

How to test

git clone -b drop-lodash-for-index https://github.com/sukkaw/hexo.git
cd hexo
npm install
npm test

Screenshots

The performance is more or less the same after this PR.

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls
Copy link

coveralls commented Nov 8, 2019

Coverage Status

Coverage increased (+0.01%) to 97.158% when pulling 9576f42 on SukkaW:drop-lodash-for-index into 1b69a53 on hexojs:master.

Copy link
Contributor

@curbengh curbengh left a comment

Choose a reason for hiding this comment

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

Tested Object.assign on default_config.js.

@curbengh
Copy link
Contributor

Please verify the benchmark (rebase first) before merging.

@SukkaW
Copy link
Member Author

SukkaW commented Nov 30, 2019

@curbengh Last time I check, the benchmark seems no difference. I will trigger a rebuild to see if there is any regression.


Benchmark result:

Node.js 8

Process Time Memory
Current Master Branch 30.6s 671MB
This PR 31.4s 678MB

Node.js 10

Process Time Memory
Current Master Branch 25.1s 628MB
This PR 26.8s 629MB

Node.js 12

Process Time Memory
Current Master Branch 25.1s 707MB
This PR 26.8s 801MB

Node.js 13

Process Time Memory
Current Master Branch 25.2s 805MB
This PR 25.6s 770MB

I think it is ok to merge. There is no significant performance impact.

@SukkaW SukkaW merged commit 5fba0a0 into hexojs:master Nov 30, 2019
thom4parisot pushed a commit to thom4parisot/hexo that referenced this pull request Jan 17, 2020
* refactor: drop lodash.cloneDeep for lib/hexo/index.js
* refactor: drop lodash.debounce for lib/hexo/index.js
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.

3 participants