uschindler commented on code in PR #15866:
URL: https://github.com/apache/lucene/pull/15866#discussion_r2984020731
##########
lucene/core/src/java25/org/apache/lucene/internal/vectorization/NativeVectorUtilSupport.java:
##########
@@ -259,7 +259,9 @@ private static float invokeFloatMethodHandle(MethodHandle
mh, MemorySegment a, M
private static <T> T invokeOrDelegate(MethodHandle mh, Supplier<T> delegate,
Object... args) {
if (mh != null) {
try {
- return (T) mh.invokeExact(args);
+ // TODO: This is slow and we should avoid dynamic invocations and
improve the test coverage
+ // (https://github.com/apache/lucene/issues/15840)
+ return (T) mh.invokeWithArguments(args);
Review Comment:
I still think this should be different. Keep the invokeExact() here and
convert the MethodHandle for delegate and foreign function using
`asSpreader(Object[].class, numberOfParams)`. That's a bit faster, but still
has the varargs array creation and conversion of primitives to wrappers.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]