PackageHoister seed takes a very long time (stuck) on complex / monorepo / workspaces projects

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

Installing large, complex projects (10k total transitive and non-transitive dependencies) spend most of their time in getFlatHoistedTree:

screen shot 2018-04-06 at 1 27 09 pm

I’m working on a generic reproducible case, but to summarize, I have 542 workspaces in one yarn project, and generating the lockfile is pretty much stuck in the getFlatHoistedTree / package-hoister seed.

I think the queue contains around 12 million objects, and I think repeatedly iterating and copying the objects is causing the degradation.

Is there a way to optimize this?

Node Version: 9+
Yarn: 1.6.1+

Author: Fantashit

1 thought on “PackageHoister seed takes a very long time (stuck) on complex / monorepo / workspaces projects

  1. This is a nice analysis, finally we are getting bottlenecked not on IO 🙂

    Any suggestions/PR on data structures/caches?

Comments are closed.