rmuir commented on code in PR #12731:
URL: https://github.com/apache/lucene/pull/12731#discussion_r1375244023


##########
lucene/core/src/java20/org/apache/lucene/internal/vectorization/PanamaVectorUtilSupport.java:
##########
@@ -77,6 +77,47 @@ final class PanamaVectorUtilSupport implements 
VectorUtilSupport {
         VectorizationProvider.TESTS_FORCE_INTEGER_VECTORS || 
(isAMD64withoutAVX2 == false);
   }
 
+  private static final String MANAGEMENT_FACTORY_CLASS = 
"java.lang.management.ManagementFactory";
+  private static final String HOTSPOT_BEAN_CLASS = 
"com.sun.management.HotSpotDiagnosticMXBean";
+
+  // best effort to see if FMA is fast (this is architecture-independent 
option)
+  private static boolean hasFastFMA() {
+    // on ARM cpus, FMA works fine but is a slight slowdown: don't use it.
+    if (Constants.OS_ARCH.equals("amd64") == false) {
+      return false;
+    }
+    try {
+      final Class<?> beanClazz = Class.forName(HOTSPOT_BEAN_CLASS);
+      // we use reflection for this, because the management factory is not part
+      // of Java 8's compact profile:
+      final Object hotSpotBean =

Review Comment:
   it works with the module system at least: i tested it. If we want to move 
this code around i am fine, as long as i have `static final` constant.



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