mcimadamore commented on PR #912:
URL: https://github.com/apache/lucene/pull/912#issuecomment-1324947263

   @sherman I believe there is a big difference in performance between Java 19 
and Java 17. Java 19 is the first release of the API where loop optimizations 
and range check elimination are correctly implemented for loops over `long` 
induction variable. Up to Java 19, there used to be some black magic in the FFM 
API implementation to use a "fast path" when a segment was detected to have a 
size that would fit an integer. But this resulted in multiple code paths, and, 
sometimes, suboptimal optimizations.
   
   On top of that, IIRC, Java 17 is missing all the static `copy` methods 
(these were added in Java 18). These have been added precisely to address some 
performance concerns raised by the Lucene team (as copying data from heap 
arrays to off-heap memory would require, using the Java 17 API, creating 
intermediate memory segment instances).
   
   Finally, Java 18 also add instance dereference methods on the MemorySegment 
class. E.g. no more static methods on `MemoryAccess` (that class is now gone). 
Again, this provides some improvements, as C2 is better equipped to speculate 
on the receiver type of a memory segment.
   
   @uschindler can correct me if I'm wrong, but I believe that the numbers he 
got against Java 17 were not too great.


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