Thanks to visit codestin.com
Credit goes to github.com

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 2c8ba9b

@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 Jan 14, 2026 4:25pm

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?

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

@batusai513
Copy link
Author

@JamesHenry happy new year, hope you or anyone of your team can find some time to review these changes, our release pipeline is just too slow and we would love speed up the release process.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 14, 2026

View your CI Pipeline Execution ↗ for commit 4e33ed4

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ⛔ Cancelled 12m 59s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 48s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-14 07:42:45 UTC

@JamesHenry
Copy link
Collaborator

Thank you @batusai513, sorry for the holiday delay - I have triggered CI to run, the things I spotted were mainly just the code not matching existing conventions (and also not super consistent with itself in terms of method vs function property assignment)

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.
- move the instance into release-graph class
- pass resolveGitTags as params
@batusai513 batusai513 force-pushed the improve-release-performance branch from 4e33ed4 to 2c8ba9b Compare January 14, 2026 16:19
@batusai513
Copy link
Author

batusai513 commented Jan 14, 2026

@JamesHenry thanks for the review, I've changed to use methods and changed to use .bind to maintain the correct this context where I am passing the method reference as a callback parameter.

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