Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-25699

[GSS](8.0.z) JANDEX-50 - AnnotationInstance hash collissions degrade indexing processing time

    XMLWordPrintable

Details

    Description

      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)
      

      Attachments

        Issue Links

          Activity

            People

              lthon@redhat.com Ladislav Thon
              pberan@redhat.com Petr Beran
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: