Maybe we can start with the simple code by removing synchronized and reset. Using MethodHandle should be treated separately (in a dedicated ticket and PR).
Konrad > On 6. Dec 2021, at 16:03, Paul Bjorkstrand <[email protected]> wrote: > > It may be possible to do that, by doing a reflective check on that method > and calling that method reflectively (or via method handles, since it is > public). The code might be a bit complex, but I'll give it a go. > > -Paul > > > On Mon, Dec 6, 2021 at 3:22 AM Robert Munteanu <[email protected]> wrote: > >> Hi Paul, >> >> On Sat, 2021-12-04 at 21:38 -0600, Paul Bjorkstrand wrote: >>> I added in using MethodHandles in the tests, just to show the >>> difference. >>> When Sling stops supporting Java 8, we can move to MethodHandle which >>> has >>> significantly better performance characteristics. Unfortunately, we >>> can't >>> make that move until we are on at least Java 9, so that we can use >>> MethodHandles.privateLookupIn(..) [2]. >> >> Thanks for the comprehensive tests. Would it be possible to try >> MethodHandles and fall back to reflection is they're not available? >> >> Thanks, >> Robert >>
