Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10969

Remove synchronized & rest of accessible flag during injection

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Models Implementation 1.4.16
    • Sling Models
    • None

    Description

      To improve multithreaded performance of Sling Models, the synchronized blocks, along with the "reset" of the setAccessible using its original value should be removed.

      Context:
      The synchronized blocks were added to resolve a race condition [1]. After looking into another large project that uses reflection to access members of classes (Felix [2]), nowhere in that project is something similar being done. Every reflective access is just doing setAccessible(true).

      Results from a JMH test allude to a significant performance improvement during multithreaded threaded access by removing the synchronized (JMH results [3]).

      [1]: SLING-6584
      [2]: https://github.com/apache/felix-dev/search?q=setAccessible
      [3]: https://gist.github.com/paul-bjorkstrand/f3bb154665e7d2168b4656eb7b794496
      [4]: https://www.mail-archive.com/dev@sling.apache.org/msg113123.html
      [5]: https://github.com/apache/sling-org-apache-sling-models-impl/pull/11

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              paul.bjorkstrand Paul Bjorkstrand
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m