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 proper command line argument parser #1

Closed
wants to merge 4 commits into from

Conversation

lo1tuma
Copy link

@lo1tuma lo1tuma commented Jun 24, 2021

Hi, I’ve stumbled upon this project and I’m currently experimenting with it in some projects to see how the compile time could improve.
One thing I’ve noticed is that npx parallel-typescript --workers doesn’t work because --workers is passed on the same position as the tscPath argument is expected (process.argv[3]).

To solve this I’ve chosen the cmd-ts library which has excellent typescript support. Unfortunately this library depends on a modern typescript version so I also had to update typescript. Additionally I needed to remove tslint because it is deprecated and not compatible with latest typescript versions.

TSLint has been deprecated in favor of @typescript-eslint.
Before running `npx parallel-typescript --wrokers` did not work because
`--workers` is placed as the third argument which is also used as the
configurable `tscPath`.
@lo1tuma lo1tuma changed the title Cmd parser Use proper command line argument parser Jun 24, 2021
@timocov
Copy link
Owner

timocov commented Jun 26, 2021

Hi @lo1tuma, are you using this project parallel-typescript somewhere? I mean, I created this repo as a POC mostly to show how the compiler might work in parallel, but I don't think that it's good to use it in the production (I even didn't maintain it properly).

@lo1tuma
Copy link
Author

lo1tuma commented Jun 28, 2021

Hi @timocov, I’m still experimenting with it. In one of my projects the compile time via tsc -b takes around 8 minutes (which is really painfully long) and with parallel-typescript I can cut this down to 3 minutes on my macbook (12 cores). However I’ve noticed parallel-typescript to be significantly slower (more than 20 minutes) when using it on certain VMs in our CI which only have 2 cores.
My assumption was that the context switching overhead of running more threads as available cores slows down the compiler even further. So I did some experimentation with a worker pool which brought me back to 8 minutes compile time on a 2-core VM.

@timocov
Copy link
Owner

timocov commented Oct 31, 2021

Hi @lo1tuma, I'm sorry for late reply. I had to say that earlier, but I'm not going to maintain this project in the future. I created it just to show that if we run ts in parallel it might be faster because of using all available cores of your computer for microsoft/TypeScript#30235 (comment). I personally think that it should be implemented in the compiler itself (or be a part of the compiler repo/microsoft open-source like https://github.com/microsoft/rushstack).

Please let me know if you're unable to use your fork in the production instead of this package so we could adjust your fixes and push them within this package. but I think it shouldn't be a problem at all since you can easily publish any package to npm.

Sorry once again for such long reply.

@timocov timocov closed this Oct 31, 2021
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.

2 participants