Navigation Menu

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

fix: drastically reduce time taken to check for cycles #2874

Merged
merged 1 commit into from Jun 14, 2022
Merged

fix: drastically reduce time taken to check for cycles #2874

merged 1 commit into from Jun 14, 2022

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Apr 14, 2021

In our monorepo with 219 packages, lerna exec takes 5 minutes
to check for cycles in our package graph.

Most of time is spent checking and re-checking the same nodes over
and over again.

Add a double-work breaker (a Set of already-visited nodes) to only
visit every package once.

Brings the time taken down to virtually nothing.

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

ghiscoding added a commit to lerna-lite/lerna-lite that referenced this pull request Feb 5, 2022
In our monorepo with 219 packages, `lerna exec` takes 5 minutes
to check for cycles in our package graph.

Most of time is spent checking and re-checking the same nodes over
and over again.

Add a double-work breaker (a `Set` of already-visited nodes) to only
visit every package once.

Brings the time taken down to virtually nothing.
Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rix0rrr 👋

Thank you very much for taking the initiative to contribute this PR!

You may or may not know that lerna is now under the stewardship of Nrwl (announcement here #3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details).

Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves.

We hope you will continue to be a part of this community as we look to take things forward from here!

Please see #3140 for more details on our plans for 2022.

Many thanks again 🙏

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.

None yet

2 participants