-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix: reduce number of concurrent git processes spawned #10354
Conversation
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: -930 B (-0.01%) Total Size: 10.9 MB ℹ️ View Unchanged
|
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.
The implementation @t1m0thyj provided works but it not ideal:
- variable name does not match implementation
- does not maximise throughput
const results = []; | ||
while (docFiles.length > 0) { | ||
const batch = docFiles.splice(0, Concurrency); | ||
const batchResults = await Promise.all(batch.map(processVersionDoc)); | ||
results.push(...batchResults); | ||
} | ||
return results; |
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.
If Git is the bottleneck, and the env variable name contains Git, then we should limit the concurrent of Git access, and not create chunks of docs processing
The variable name does not match the implementation detail.
Also chunking is not ideal because we can't start new IO work until a full chunk has ended, and we have to wait for the slowest of the 100 docs to have finished processing before starting processing the 100-200 dos chunk.
Using something like https://github.com/sindresorhus/p-queue is better
Pre-flight checklist
Motivation
Replace #10349
Fix #10348
Confirm local fix on https://github.com/zowe/docs-site/ on my M2 Pro
Test Plan
? Wonder how to test this
Test links
Deploy preview: https://deploy-preview-10354--docusaurus-2.netlify.app/