Make some native vectorization classes package private to be consistent and a minor fix#15866
Conversation
…nit and a minor fix
uschindler
left a comment
There was a problem hiding this comment.
The slow code is at least working. It is a not of work.
For testing we can use a trick without native code: Maybe define java methods with correct signature with scalar impl and hook them in for testing. So method able to be called is just a mich deleting to a java class.
| 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); |
There was a problem hiding this comment.
I still think this should be different. Keep the invokeExact() here and convert the MethodHandle for 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.
There was a problem hiding this comment.
Make sense, I switched it to back this invokeExact way
There was a problem hiding this comment.
This may not work so easy, so let's do that later. We need tests. But in the ideal case we should call all methods statically. Its more try-catch logic but it is needed for performance.
This reverts commit a1b8c53.
Description