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

   > > The problem we are seeing here is due to the stupid _capturing_ lambda: 
The problem is that the referee (the MemorySegment or the ByteBuffer where the 
data is read from) is not compiled into the lambda code and needs to be 
captured and bound at runtime. This causes instances of the lambda class to be 
created on each call and escape analysis does not seem to work well.
   > 
   > Annoying. Does java provide a way to make a `static` lambda? So that it 
won't capture the runtime scope it's birthed in?
   
   You can do this by not referring to any external fields (captures "this") or 
local variables of calling method. This could be fixed by using a 
BiFunction-like signature, but it still adds useless abstractions. Using the 
Varhandle and passing it around is much better and "correct". BTW, the new 
varhandle code passes the underlying storage as an anonymous extra parameter to 
the implementation.


-- 
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