Comments (8)
In your very first message you point into the right place in sourcecode which should be parallelized. Start from there.
from js-lingui.
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
from js-lingui.
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.
from js-lingui.
BTW p-limit
doesn't really help here because while extracting we invoking Babel on a bundles, which are single big file. Babel is very CPU bound and synchronous by nature. In all bounding code there also not much async operations, so you will not benefit of running them in one node process.
from js-lingui.
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.
from js-lingui.
FYI https://www.npmjs.com/package/jest-worker
from js-lingui.
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.
- Passing a lingui config to child workers (config is not serializable to json, as it might have custom formatters / extractors as function). So you rather need to read config in each thread by it's own (this might bring a significant overhead!)
- Passing a Catalog instance object, this should be just designed in diffrent way.
from js-lingui.
Got it, how about make each worker to extract each entry? It seems isolated.
from js-lingui.
Related Issues (20)
- Update @lingui/vite-plugin to support Vite 5 HOT 10
- Usage with vue & vite with vite plugin HOT 1
- Broken build on CI HOT 6
- Double Render caused by wrong assertion HOT 1
- [Vite] Parentheses in catalog pathnames causes them to be unrecognized HOT 1
- Double render due to wrong assertion on nextjs-babel example HOT 1
- Using Trans inside a Plural macro unexpectedly replaces "#" found in variables HOT 5
- Webpack warning lingui-loader with pnpm HOT 2
- Examples show useEffect deps warning HOT 1
- Cannot kill git pre-commit hook while lingui command is running HOT 4
- Provide some way to turn off newline collapsing HOT 2
- `unraw` default export resolution error in React Native 0.73.2 HOT 1
- Dynamic loading not working with Expo HOT 1
- Support check the translated `msgstr` as expected HOT 2
- Lingui doesn't extract msg within a msg HOT 2
- lingui extract-experimental empty space after {} HOT 2
- Error when aliasing Trans from '@lingui/react' in presence of macro Trans from '@lingui/macro' HOT 2
- `Nextjs` `swc` plugin example not working HOT 3
- Macro: t inside t causing ReferenceError: t is not defined HOT 3
- why not working plural macro? please help me...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-lingui.