microsoft / parallel-prettier

Concurrent prettier runner
MIT License
203 stars 19 forks source link

feat: use worker_threads instead of cluster for parallelism #8

Closed trivikr closed 3 years ago

trivikr commented 3 years ago

I was experimenting with using worker_threads instead of cluster, so posting this PR if maintainer wants to pick it up. The performance has slightly worsened (around ~5%) in my tests, so I'm closing this PR.

connor4312 commented 3 years ago

Thanks for the investigation. I looked at this last year and found much the same.

From what I've heard so far the main benefit in worker_threads is better message passing, but that's not a bottleneck here and it seems like there's other overhead that makes it slightly slower.