Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-4292

Improve getLastChange and branch listing

    XMLWordPrintable

    Details

      Description

      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:

      1. List all the branches
      2. For each branch in the list, get the last commit by doing:
        1. Ensure the branch existence (List all the branches, and for-loop to find out if it contains the target branch)
        2. 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-4269 to performance manually (results have been added into that ticket).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours, 10 minutes
                  1d 4h 10m