Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2804

ApplicationServiceGeneric.searchUsers is slow with large numbers of users

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • 2.3.8, 2.4.3, 2.5
    • None
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      ApplicationServiceGeneric uses a locale-specific case-insensitive comparison that takes a long time when large numbers of users are returned.

      (EMBCWD-885)

            [CWD-2804] ApplicationServiceGeneric.searchUsers is slow with large numbers of users

            Thanks Joe!
            Looking forward to the releases so we can consume this

            Mark Lassau (Inactive) added a comment - Thanks Joe! Looking forward to the releases so we can consume this

            jwalton We want to get this fix in JIRA 5.0.x and 5.1 which means we would need it backported to Crowd 2.3.x and 2.4.x
            I spoke to Justin K about it this morning and he agreed that we should do this.

            Mark Lassau (Inactive) added a comment - jwalton We want to get this fix in JIRA 5.0.x and 5.1 which means we would need it backported to Crowd 2.3.x and 2.4.x I spoke to Justin K about it this morning and he agreed that we should do this.

            Use of a non-English locale for comparison is triggered by the system property crowd.identifier.language, which is described only in the Javadoc for the Crowd implementation class IdentifierUtils. Given the lack of documentation it's not likely that it's seeing widespread use.

            Actually it would also be dangerous to change as you would need to then recalculate all the "lower_user_name" etc DB columns which I am pretty sure there is no way to do supplied by the apps.
            If you did actually manage to make these changes, then your data could now break the Unique constraint on said columns.

            Mark Lassau (Inactive) added a comment - Use of a non-English locale for comparison is triggered by the system property crowd.identifier.language, which is described only in the Javadoc for the Crowd implementation class IdentifierUtils. Given the lack of documentation it's not likely that it's seeing widespread use. Actually it would also be dangerous to change as you would need to then recalculate all the "lower_user_name" etc DB columns which I am pretty sure there is no way to do supplied by the apps. If you did actually manage to make these changes, then your data could now break the Unique constraint on said columns.

            Yes, irrespective of the "crowd.identifier.language" setting, IdentifierUtils.toLowerCase() does the same thing every time, so we should pre-compute that and use a tree-map instead of a tree-set (or: use a pojo wrapper around User that memoizes the lowercase name, and use that in your treeset).

            Matt Quail (Inactive) added a comment - Yes, irrespective of the "crowd.identifier.language" setting, IdentifierUtils.toLowerCase() does the same thing every time, so we should pre-compute that and use a tree-map instead of a tree-set (or: use a pojo wrapper around User that memoizes the lowercase name, and use that in your treeset).

            joe added a comment -

            The search is expensive because each comparison converts the names to lowercase again. The fix should store the users in a Map keyed by converted lowercase name.

            joe added a comment - The search is expensive because each comparison converts the names to lowercase again. The fix should store the users in a Map keyed by converted lowercase name.

            joe added a comment -

            Use of a non-English locale for comparison is triggered by the system property crowd.identifier.language, which is described only in the Javadoc for the Crowd implementation class IdentifierUtils. Given the lack of documentation it's not likely that it's seeing widespread use.

            joe added a comment - Use of a non-English locale for comparison is triggered by the system property crowd.identifier.language , which is described only in the Javadoc for the Crowd implementation class IdentifierUtils . Given the lack of documentation it's not likely that it's seeing widespread use.

              jwalton joe
              jwalton joe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: