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

Use PARCEL_WORKERS environment variable #589

Merged
merged 2 commits into from
Jan 20, 2018

Conversation

shawwn
Copy link
Contributor

@shawwn shawwn commented Jan 19, 2018

Per the slack convo, PARCEL_WORKERS environment variable controls how many workers to spawn, and PARCEL_WORKERS=0 makes all code run on the main thread.

PARCEL_WORKERS=0 yarn test runs about 33% faster.

@shawwn shawwn requested a review from devongovett January 19, 2018 16:17
@codecov-io
Copy link

codecov-io commented Jan 19, 2018

Codecov Report

Merging #589 into master will decrease coverage by 0.03%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #589      +/-   ##
==========================================
- Coverage   88.85%   88.81%   -0.04%     
==========================================
  Files          57       57              
  Lines        1749     1753       +4     
==========================================
+ Hits         1554     1557       +3     
- Misses        195      196       +1
Impacted Files Coverage Δ
src/WorkerFarm.js 93.87% <75%> (-1.78%) ⬇️
src/utils/emoji.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a120fbb...95d214f. Read the comment docs.

@@ -97,6 +99,9 @@ for (let key in EventEmitter.prototype) {
}

function getNumWorkers() {
if (process.env.PARCEL_WORKERS) {
return parseInt(process.env.PARCEL_WORKERS);
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend you to specify the radix argument, else it'll be infered. Eg. parseInt('0x0101') = 257 while parseInt('0x0101', 10) = 0.

@devongovett devongovett merged commit 0a2f554 into master Jan 20, 2018
@devongovett devongovett deleted the features/parcel-workers-env branch January 20, 2018 20:21
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* Use PARCEL_WORKERS environment variable

* Update WorkerFarm.js
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* Use PARCEL_WORKERS environment variable

* Update WorkerFarm.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.

4 participants