Skip to content

Conversation

@batusai513
Copy link

@batusai513 batusai513 commented Dec 15, 2025

Current Behavior

When releasing packages using nx release using conventional commits and independent versions for the packages in a large repository, with 232 projects and hefty git history with several thousand tags, the release process takes more than 30 minutes.

Expected Behavior

When releasing package using nx release, it should not take more than 30 minutes to release all package in a big monorepo.

Related Issue(s)

Fixes #33865

@batusai513 batusai513 requested review from a team and Coly010 as code owners December 15, 2025 15:58
@batusai513 batusai513 requested a review from MaxKless December 15, 2025 15:58
@netlify
Copy link

netlify bot commented Dec 15, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 25aba4b

@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Dec 21, 2025 11:25am

Copy link
Collaborator

@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.

Thanks a lot for this, seems like it's going to be a great improvement. Instinctively these caching elements feel like they belong on the ReleaseGraph as it already performs many similar operations to reduce rework and is passed between different subsections of the release process and ultimately can be dropped without any module level cache clearing etc.

Please could you explore that?

@batusai513
Copy link
Author

batusai513 commented Dec 16, 2025

@JamesHenry yes, I could explore that possibility, in this case, what api changes would you suggest I can do to move this into the ReleaseGraph?

Implemented RepoGitTags singleton class to cache git tags and eliminate
redundant git operations during release commands.

This function is called for each project in an independent versions
configuration, once when calculating the next versions and once angain
when creating the changelogs

Performance improvement:
- Constant time after first call

The cache is automatic and transparent. Added clean() method for test
isolation.

No breaking changes.
…ions across projects

Added affectedGraphPerCommit cache to avoid recomputing graph traversals
when multiple projects analyze the same commits during release.

For independent release groups, this provides 90-98% performance
improvement
for subsequent projects by reusing graph computations from the first
project.

The cache is keyed by commit hash, stored during release operations, and
automatically cleared after processGroups() completes to prevent memory
leaks in long-running processes like Nx daemon.

No breaking changes.
@batusai513
Copy link
Author

batusai513 commented Dec 21, 2025

@JamesHenry I've moved both the cache and the resolve logic to the ReleaseGraph class, I hope this is somewhat related to what you had in mind.

- move the instance into release-graph class
- pass resolveGitTags as params
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.

Performance issues with nx release on large monorepos

2 participants