Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Models Implementation 1.4.16
-
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
- relates to
-
SLING-6584 Race condition in ModelAdapterFactory
- Closed