-
Notifications
You must be signed in to change notification settings - Fork 385
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
lingui-extract-experimental.ts extractFromFiles
concurrently?
#1798
Comments
i considered implementing a worker thread pool to do so. But for first iteration stopped as it is now. You probably a first user who really started experimenting with that and we started getting the feedback. If you have capacity for implement worker threads i would happy to help. But for now i'm out of capacity to do so by my own. |
BTW |
Thanks for you patient explanation. I'm not familier with worker threads, but very interesting of it. I'll study the theory first, glad to join the work if possible. |
The caveat of working with workers - you don't have a shared memory between it. Treat them as few standalone nodejs programs ran by another one. So if you want to expose something for all workers, you could not just store it in some global variable. Usually, passing data between main / child processes is done by serializing and storing in some place, and then reading and deserializing it on another side. So you could not pass from main process to child something non-serializable, say a function or class instance. In lingui there might be few places where it's needed, and should be re-designed in a different way.
|
Got it, how about make each worker to extract each entry? It seems isolated. |
In your very first message you point into the right place in sourcecode which should be parallelized. Start from there. |
I know that Vitest instead of using jest-worker is using Piscina https://www.npmjs.com/package/piscina which is more robust by far than jest-worker, probably could be a good addition here |
Is your feature request related to a problem? Please describe.
For big project, it is too slow to extractFromFiles, after investigation, how about to make lingui-extract-experimental.ts
extractFromFiles
concurrently?js-lingui/packages/cli/src/lingui-extract-experimental.ts
Line 73 in 04b7cef
Describe proposed solution
p-limit
?The text was updated successfully, but these errors were encountered: