3 Replies Latest reply on Jul 24, 2008 7:33 AM by Ales Justin

    CopyOnWriteArraySet - JBCL-20

    Adrian Brock Master

      https://jira.jboss.org/jira/browse/JBCL-20

      I was seeing a lot of time spent in CopyOnWriteArraySet when checking
      blacklisting in the classloader.

      The reason is that the class isn't intended for large data sets,
      in fact it uses a CopyOnWriteArrayList underneath and does linear traversals.

      I've changed the usage to a ConcurrentHashMap where I effectively
      only use the key side.

      It might be an idea to add a ConcurrentSet implementation to common-core
      that is implemented on top of a ConcurrentHashMap?

        • 1. Re: CopyOnWriteArraySet - JBCL-20
          Adrian Brock Master

          Incidently the reason the blacklist is so large is because we are still using the
          old annotation scanning (which has the problem I reported a couple of months ago).

          i.e. if you have an unpacked subdeployment, it thinks
          subdeployment.jar/org/jboss/whatever/Some.class
          might be a class.

          When it fails to the load the class, it fills ups the blacklist.

          This is besides it wasting time scanning things it doesn't need to
          and creating lots of unnecessary ClassNotFoundExceptions.

          • 2. Re: CopyOnWriteArraySet - JBCL-20
            Ales Justin Master

             

            "adrian@jboss.org" wrote:
            It might be an idea to add a ConcurrentSet implementation to common-core
            that is implemented on top of a ConcurrentHashMap?

            OK, I'll add this to the common-core.
            Any other collection API we can/should add?

            • 3. Re: CopyOnWriteArraySet - JBCL-20
              Ales Justin Master

               

              "adrian@jboss.org" wrote:
              Incidently the reason the blacklist is so large is because we are still using the
              old annotation scanning (which has the problem I reported a couple of months ago).

              This should all go away once we switch to my annotation scanning. ;-)
              It should be soon, since I saw Emanuel finished the Metadata changes required to have more optimized lookup actions.