Skip to content

Commit 9c21634

Browse files
committed
Inform users about Vector API perf expectations.
1 parent c9de8f1 commit 9c21634

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporterFeature.java

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.oracle.svm.hosted.util.CPUTypeAMD64;
4646
import com.oracle.svm.hosted.util.CPUTypeRISCV64;
4747
import com.oracle.svm.util.LogUtils;
48+
import com.oracle.svm.util.ReflectionUtil;
4849

4950
@AutomaticallyRegisteredFeature
5051
public class ProgressReporterFeature implements InternalFeature {
@@ -62,6 +63,15 @@ public void duringAnalysis(DuringAnalysisAccess access) {
6263
reporter.reportStageProgress();
6364
}
6465

66+
@Override
67+
public void afterAnalysis(AfterAnalysisAccess access) {
68+
var vectorSpeciesClass = ReflectionUtil.lookupClass(true, "jdk.incubator.vector.VectorSpecies");
69+
if (vectorSpeciesClass != null && access.isReachable(vectorSpeciesClass)) {
70+
LogUtils.warning(
71+
"This application uses a preview of the Vector API, which is functional but slow on Native Image because it is not yet optimized by the Graal compiler. Please keep this in mind when evaluating performance.");
72+
}
73+
}
74+
6575
@Override
6676
public void afterCompilation(AfterCompilationAccess access) {
6777
if (SubstrateOptions.BuildOutputBreakdowns.getValue()) {

0 commit comments

Comments
 (0)