Opening a file is too slow

XMLWordPrintable

    • 3
    • 3

      We have a huge repository (source code of chromium-based browser).

      And any file opening takes 20+ seconds while listing a directory is almost instantaneous:

       

      time curl "https://$HOST/projects/$PROJECT/repos/REPOSITORY/browse/$RELPATH" > /dev/null
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100 28047    0 28047    0     0   1188      0 --:--:--  0:00:23 --:--:--  6477
      real 0m23.633suser 0m0.021ssys 0m0.025s 
      

      While debugging on the server we observed that it is so slow because of this git call:

       

      [18197ms] - Page com.atlassian.bitbucket.commit.CommitService.getCommits(CommitsRequest,PageRequest)
       [18190ms] - /usr/bin/git log --format=commit %H%n%H%x02%P%x02%aN%x02%aE%x02%at%x02%cN%x02%cE%x02%ct%n%B%n%x03END%x04 --no-min-parents --stdin --follow --name-status -- $RELPATH
      
      

      This means that while generating webpage Bitbucket fetches entire history of the file. And this webpage does not display full history anywhere. I suppose full history can be used in two places on that webpage:

      1. Last commit and committer. There is no need to fetch full history for that. We can add "-1" to "git log" call, which makes it 10x faster for our repository.
      2. History button. It is also very slow, I suppose another `git log` is called.

            Assignee:
            Unassigned
            Reporter:
            Slava Yozhkin
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: