Uploaded image for project: 'Jandex'
  1. Jandex
  2. JANDEX-50

AnnotationInstance hash collissions degrade indexing processing time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None

      The AnnotationInstance.equals() method considers two annotations that are basically the same as distinct if they don't have the same target. However, the AnnotationInstance.hashCode() method does not take the target into account at all, which leads to hash table collisions.

      This can lead to extra overhead and processing time in StrongInternPool.intern as it runs into increasing amounts of index loops repeating equal calls if there happen to be lots of similar methods (same method name, parmeters, annotations and return but in different classes):

         java.lang.Thread.State: RUNNABLE
      	at org.jboss.jandex.StrongInternPool.eq(StrongInternPool.java:139)
      	at org.jboss.jandex.StrongInternPool.intern(StrongInternPool.java:246)
      	at org.jboss.jandex.NameTable.intern(NameTable.java:109)
      	at org.jboss.jandex.ClassInfo.setMethods(ClassInfo.java:781)
      	at org.jboss.jandex.Indexer.index(Indexer.java:1992)
      

              lthon@redhat.com Ladislav Thon
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: