Agreed, Konrad. That was the way I was going to approach it. I am adding the "remove sync" ticket now, and will add the MethodHandles ticket after I have the PR for sync removal in, since it is far simpler.
-Paul On Mon, Dec 6, 2021 at 9:07 AM Konrad Windszus <konra...@gmx.de> wrote: > 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 <paul.bjorkstr...@gmail.com> > 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 <romb...@apache.org> > 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 > >> > >