Quick file search on Mercurial repos with large manifests is too expensive (BB-10299)

Issue #9150 closed
Yongtao Hu created an issue

It's cool that Bitbucket allows fast search by simply pressing F in a repo page.

I am wondering is there any way we can improve this, i.e. custom search within given folders or be able to neglect some folders? This will be much helpful (speedup) especially the repo contains a lot of files.

Comments (15)

  1. Erik van Zijst

    What exactly would you expect to see? How would ignoring work? Is that something that one would need configure somewhere first? Or would you expect to only match files underneath the directory that you are viewing in the source browser? If so, what if you would quickly want to navigate to a file in the root directory? Or indeed, navigate directly to the root dir?

  2. Yongtao Hu reporter

    @Erik van Zijst Hi, Erik, sorry for not being clear. I actually expect the search to be a little bit smarter when dealing with large repo that contains lots of files.

    As far as I can see, current search is always trying to search a file in the whole file tree of the repo, which is slow when dealing with large repos. What I want is to the ability to let me exclude some folders (e.g. libs folder) which I am sure my file is not within. I am not sure how much configuration will be needed.


  3. Erik van Zijst

    But where would the ignored paths be configured? Not everybody would want to exclude lib/.

    Our main goal with quick search is to give people a quick, hassle-free ability to navigate their code. Now of course if loading up the whole tree proves to be too slow in some cases, then I feel we should maybe look into that first, before making it more complex.

    Which repository is this on? And how long does it take to load up the search box?

  4. Yongtao Hu reporter

    @Erik van Zijst I know that not everybody would want to exclude this particular folder, but they will need to exclude other folders if they also want to speed it up. Right?

    Of course, if you can make the search for all files fast enough for even large repos, there will be no need for this feature. :)

    P.S.: Currently, it will take over 5 seconds for me to search a particular file in one of my repos.

  5. Erik van Zijst

    Can you give me the URL of one of the repos on which it takes 5 seconds to
    load the search bar?

  6. Erik van Zijst

    I had a look at your repo and confirmed that compiling the list of files does indeed take quite a lot of time. In fact, in many of my tests it was even slower than 5 seconds, which is not what we were aiming for when we designed this feature.

    This issue seems to be related to the fact that this is a Mercurial repo (Git doesn't seem to be affected as much) and I've raised an internal issue to address this. This should make the operation faster and hopefully preempt the need for filtering.

  7. Atlassian Bitbucket

    This issue has been closed due to inactivity. If you continue to see problems, please reopen or create a new issue.

  8. Log in to comment