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 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.
@SukkaW SukkaW requested review from segayuu and curbengh Nov 8, 2019
@coveralls

This comment has been minimized.

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.

@SukkaW SukkaW added this to To do in Replace lodash with native API via automation Nov 8, 2019
Copy link
Contributor

curbengh left a comment

Tested Object.assign on default_config.js.

Replace lodash with native API automation moved this from To do to In progress Nov 30, 2019
@curbengh

This comment has been minimized.

Copy link
Contributor

curbengh commented Nov 30, 2019

Please verify the benchmark (rebase first) before merging.

@SukkaW

This comment has been minimized.

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
4 checks passed
4 checks passed
Travis CI - Pull Request Build Passed
Details
codeclimate All good!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage increased (+0.01%) to 97.158%
Details
Replace lodash with native API automation moved this from In progress to Done Nov 30, 2019
oncletom added a commit to oncletom/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
3 participants
You can’t perform that action at this time.