You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/12/06 16:08:00 UTC

[jira] [Resolved] (SLING-10969) Remove synchronized & rest of accessible flag during injection

     [ https://issues.apache.org/jira/browse/SLING-10969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus resolved SLING-10969.
-------------------------------------
    Fix Version/s: Models Implementation 1.5.0
       Resolution: Fixed

Fixed in [https://github.com/apache/sling-org-apache-sling-models-impl/commit/6a10f5640b276eb36d08c304cbdb3bd27b44010c.]

 

Thanks for the PR [~paul.bjorkstrand]!

> Remove synchronized & rest of accessible flag during injection
> --------------------------------------------------------------
>
>                 Key: SLING-10969
>                 URL: https://issues.apache.org/jira/browse/SLING-10969
>             Project: Sling
>          Issue Type: Improvement
>          Components: Sling Models
>    Affects Versions: Models Implementation 1.4.16
>            Reporter: Paul Bjorkstrand
>            Priority: Major
>             Fix For: Models Implementation 1.5.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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



--
This message was sent by Atlassian Jira
(v8.20.1#820001)