-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 stream #62
Conversation
This is just a temporary solution. We should dig into this later. |
The purpose of #22 was to prevent memory exhaustion. Using https://github.com/hexojs/site as test site (since it contains hundreds of files and used in hexojs/hexo#3758), I wonder what is the memory usage of current situation versus this PR? I will test in my workstation, but it's better if you can chime in as well. |
Current master branch: about 300MB I can see there is a lot of hard task on |
Lower memory huh. I'll test this on my end by today. I got higher memory usage. Tested on a VM with a single CPU and 4GB RAM, using Node 8.16 (for worst case scenario). Two tests were conducted in separate folders.
Current master branch:
This PR:
Node 12.12, fresh Current:
This PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current approach sacrifices too much performance for memory. I concur with reverting, at least for now.
I agree with the purpose of PR. Stream is a technique that prevents memory depletion at the expense of memory performance, but did not expect it to drop by a factor of 30. |
This PR reverts #22 since the
Database.save
becomes 30x slower based on hexojs/hexo#3758