Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

use async writeFile (instead of writeFileSync) to speed up sapper export's save fn #894

Closed
wants to merge 1 commit into from

Conversation

swyxio
Copy link

@swyxio swyxio commented Sep 14, 2019

While investigating this issue: #893 i found that this PR dramatically sped up writing of data files, reducing the likelihood that child process termination would cut short the writing of data.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)

@khrome83
Copy link

@sw-yx - i think #869 solves this. Even with writeFile being used you can still get out of memory and block i/o.

@swyxio
Copy link
Author

swyxio commented Sep 15, 2019

thank you. i see it now. i'll close this PR if that one is accepted, else this one has a smaller footprint. i think @nealalpert can use util.promisify there, its a part of the platform!

@antony
Copy link
Member

antony commented Jun 9, 2020

@sw-yx going to close this and focus on getting #869 over the line :)

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

Successfully merging this pull request may close these issues.

3 participants