8323529: Relativize test image dependencies in microbenchmarks
Reviewed-by: mcimadamore, jvernee, erikj
This commit is contained in:
parent
ba23025cd8
commit
3e19bf88d5
@ -620,11 +620,16 @@ define SetupRunMicroTestBody
|
||||
$1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)
|
||||
endif
|
||||
|
||||
# Microbenchmarks are executed from the root of the test image directory.
|
||||
# This enables JMH tests to add dependencies using relative paths such as
|
||||
# -Djava.library.path=micro/native
|
||||
|
||||
run-test-$1: pre-run-test
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, ( \
|
||||
$$(CD) $$(TEST_IMAGE_DIR) && \
|
||||
$$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
|
||||
-jar $$($1_MICRO_BENCHMARKS_JAR) \
|
||||
$$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
|
||||
|
@ -41,7 +41,7 @@ import static org.openjdk.bench.java.lang.foreign.CallOverheadHelper.*;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class CallOverheadConstant {
|
||||
|
||||
@Benchmark
|
||||
|
@ -41,7 +41,7 @@ import static org.openjdk.bench.java.lang.foreign.CallOverheadHelper.*;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class CallOverheadVirtual {
|
||||
|
||||
@Benchmark
|
||||
|
@ -51,7 +51,7 @@ import static java.lang.foreign.ValueLayout.*;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class CriticalCalls {
|
||||
|
||||
static final MethodHandle PINNED;
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Fork(3)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
public class LoopOverOfAddress extends JavaLayouts {
|
||||
|
||||
static final int ITERATIONS = 1_000_000;
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class PointerInvoke extends CLayouts {
|
||||
|
||||
Arena arena = Arena.ofConfined();
|
||||
|
@ -46,7 +46,7 @@ import static java.lang.foreign.ValueLayout.JAVA_INT;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class QSort extends CLayouts {
|
||||
|
||||
static final Linker abi = Linker.nativeLinker();
|
||||
|
@ -48,7 +48,7 @@ import static java.lang.foreign.ValueLayout.JAVA_BYTE;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class StrLenTest extends CLayouts {
|
||||
|
||||
Arena arena = Arena.ofConfined();
|
||||
|
@ -51,7 +51,7 @@ import static java.lang.foreign.ValueLayout.JAVA_BYTE;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class ToCStringTest extends CLayouts {
|
||||
|
||||
@Param({"5", "20", "100", "200"})
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(Scope.Benchmark)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = {"--enable-native-access=ALL-UNNAMED", "--enable-preview"})
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "--enable-preview", "-Djava.library.path=micro/native" })
|
||||
public class ToJavaStringTest {
|
||||
|
||||
private MemorySegment strSegment;
|
||||
|
@ -45,7 +45,7 @@ import static java.lang.invoke.MethodHandles.lookup;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class Upcalls extends CLayouts {
|
||||
|
||||
static final Linker abi = Linker.nativeLinker();
|
||||
|
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Warmup(iterations = 3, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Fork(3)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@State(Scope.Benchmark)
|
||||
public class PointerBench {
|
||||
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class PointsAccess {
|
||||
|
||||
BBPoint BBPoint;
|
||||
|
@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class PointsAlloc {
|
||||
|
||||
@Benchmark
|
||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class PointsDistance {
|
||||
|
||||
BBPoint jniP1;
|
||||
|
@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
public class PointsFree {
|
||||
|
||||
JNIPoint jniPoint;
|
||||
|
@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native" })
|
||||
|
||||
public class XorTest {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user