Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4819

Use Set instead of List for cycle detection

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Resolver

    Description

      We did some profiling of the Felix resolver in our application and 16% were spent in ArrayList#indexOf called by {{ArrayList#contains. It seems that ResolverImpl uses java.util.ArrayList for data structures on which it only calls #add and #contains with the latter being O. A java.util.HashSet is the appropriate data structure for such this use case.

      Attachments

        1. ResolverImpl.java.patch
          3 kB
          Philippe Marschall

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marschall Philippe Marschall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: