-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 70
-
Fix Version/s: 71
-
Component/s: Versioning & Branch management
-
Sprint:NOS 9.3.7
-
Story Points:3
Context
Currently, when listing branches, we provide the branch name and the last commit for each branch. The current implementation of this part is very slow. It consists 2 steps:
- List all the branches
- For each branch in the list, get the last commit by doing:
- Ensure the branch existence (List all the branches, and for-loop to find out if it contains the target branch)
- If branch exists, then get the last commit metadata
Because the branch existence (step 2.1) is a for-loop for all the branches, it's an expensive operation which is very time-consuming.
Implementation
Merge getLastChange into branch listing
Merge method getLastChange into branch listing. The new implementation will keep using Git command git-branch, and will go even further—it should resolve the pointer stored in each branch file under Git folder .git/refs/remotes/. The pointer is a SHA1 commit hash, which points to the last commit of the branch.
The result will be wrapped into Studio Business model BranchInfo directly.
Keep getLastChange method for other usages
However, we will still keep method getLastChange for other usages (only for tests).
Measure the performace
- Add unit test to measure the performance of the new branch listing.
- Reuse the code of ticket
NXS-4269to performance manually (results have been added into that ticket).
- is related to
-
NXS-4269 Investigate bottleneck with branch management listing
- Resolved
- links to