Leverage worker_threads for pre-render concurrency
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Describe the feature
The pre-render concurrency implementation relies on Promise.all, and doesn't leverage multiple cpu cores.
Multithreading can be achieved with node.js using worker_threads
We could re-implement the concurrency implementation using worker threads, which would fix memory issues as we could apply concurrency based on available cores.
There's a couple libraries that makes things easier here https://github.com/piscinajs/piscina or https://github.com/andywer/threads.js
Additional information
- Would you be willing to help implement this feature?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current pre-render concurrency implementation that uses Promise.all, then review Node.js worker_threads and the suggested Piscina or threads.js libraries. The work is complete when pre-rendering uses worker-based concurrency constrained by available CPU cores and the reported memory issues are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100