uschindler commented on issue #15079:
URL: https://github.com/apache/lucene/issues/15079#issuecomment-3198381877

   I have a fix for the stupid lamda code, by using VarHandles directly. So the 
readVInt callback now directly uses the VarHandle to the ByteBuffer or the 
MemorySegment (with some adaptions). The PR is still draft, as it needs more 
documentation, but generally it works. The micro-benchmarks done by @rmuir and 
myself look like improving the MemorySegment by 25% and removing GC and 
flakiness. For ByteBuffersDirectory the speed is same as before.
   
   The problem we are seeing here is due to the stupid lambda: The problem is 
that the referee (the MemorySegment or the ByteBuffer where the data is read 
from) is not compiled and bound statically into the lambda's MethodHandle but a 
new one needs to be created each time.
   
   This code using VarHandles uses a static final VarHandle and passes the 
referee separately as untyped parameter.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to