Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21969

Performance issue with search box

XMLWordPrintable

      The current search box is very inefficient when checking for suggestions. When a user enters part of a username waiting for the autocomplete to finish, if there are a lot of users it can take a very long time.

      While running a search in the search box I ran a quick thread dump to find out where the suggest was being stuck at and found:

      Handling GET /jenkins/search/suggest : … state=RUNNABLE
          at java.lang.String$CaseInsensitiveComparator.compare(String.java:1170)
          at java.lang.String.compareToIgnoreCase(String.java:1220)
          at hudson.model.User$1.compare(User.java:397)
          at hudson.model.User$1.compare(User.java:395)
          at java.util.TimSort.mergeLo(TimSort.java:687)
          at java.util.TimSort.mergeAt(TimSort.java:483)
          at java.util.TimSort.mergeCollapse(TimSort.java:408)
          at java.util.TimSort.sort(TimSort.java:214)
          at java.util.TimSort.sort(TimSort.java:173)
          at java.util.Arrays.sort(Arrays.java:659)
          at java.util.Collections.sort(Collections.java:217)
          at hudson.model.User.getAll(User.java:395)
          at hudson.model.User$FullNameIdResolver.resolveCanonicalId(User.java:735)
          at hudson.model.User.get(User.java:326)
          at hudson.model.User.get(User.java:299)
          at hudson.model.User.get(User.java:354)
          at hudson.model.User.current(User.java:366)
          at hudson.search.UserSearchProperty.isCaseInsensitive(UserSearchProperty.java:26)
          at hudson.search.CollectionSearchIndex.suggest(CollectionSearchIndex.java:61)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:63)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:62)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:62)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:62)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:62)
          at hudson.search.UnionSearchIndex.suggest(UnionSearchIndex.java:63)
          at hudson.search.Search$Mode$2.find(Search.java:192)
          at hudson.search.Search.find(Search.java:343)
          at hudson.search.Search.suggest(Search.java:268)
          at hudson.search.Search.getSuggestions(Search.java:134)
          at hudson.search.Search.doSuggest(Search.java:117)

            schristou Steven Christou
            schristou Steven Christou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: