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)
|
$1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)
|
||||||
endif
|
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
|
run-test-$1: pre-run-test
|
||||||
$$(call LogWarn)
|
$$(call LogWarn)
|
||||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
|
||||||
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, ( \
|
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, ( \
|
||||||
|
$$(CD) $$(TEST_IMAGE_DIR) && \
|
||||||
$$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
|
$$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
|
||||||
-jar $$($1_MICRO_BENCHMARKS_JAR) \
|
-jar $$($1_MICRO_BENCHMARKS_JAR) \
|
||||||
$$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
|
$$($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)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class CallOverheadConstant {
|
||||||
|
|
||||||
@Benchmark
|
@Benchmark
|
||||||
|
@ -41,7 +41,7 @@ import static org.openjdk.bench.java.lang.foreign.CallOverheadHelper.*;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class CallOverheadVirtual {
|
||||||
|
|
||||||
@Benchmark
|
@Benchmark
|
||||||
|
@ -51,7 +51,7 @@ import static java.lang.foreign.ValueLayout.*;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class CriticalCalls {
|
||||||
|
|
||||||
static final MethodHandle PINNED;
|
static final MethodHandle PINNED;
|
||||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||||
@Fork(3)
|
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||||
public class LoopOverOfAddress extends JavaLayouts {
|
public class LoopOverOfAddress extends JavaLayouts {
|
||||||
|
|
||||||
static final int ITERATIONS = 1_000_000;
|
static final int ITERATIONS = 1_000_000;
|
||||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class PointerInvoke extends CLayouts {
|
||||||
|
|
||||||
Arena arena = Arena.ofConfined();
|
Arena arena = Arena.ofConfined();
|
||||||
|
@ -46,7 +46,7 @@ import static java.lang.foreign.ValueLayout.JAVA_INT;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class QSort extends CLayouts {
|
||||||
|
|
||||||
static final Linker abi = Linker.nativeLinker();
|
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)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class StrLenTest extends CLayouts {
|
||||||
|
|
||||||
Arena arena = Arena.ofConfined();
|
Arena arena = Arena.ofConfined();
|
||||||
|
@ -51,7 +51,7 @@ import static java.lang.foreign.ValueLayout.JAVA_BYTE;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class ToCStringTest extends CLayouts {
|
||||||
|
|
||||||
@Param({"5", "20", "100", "200"})
|
@Param({"5", "20", "100", "200"})
|
||||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(Scope.Benchmark)
|
@State(Scope.Benchmark)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class ToJavaStringTest {
|
||||||
|
|
||||||
private MemorySegment strSegment;
|
private MemorySegment strSegment;
|
||||||
|
@ -45,7 +45,7 @@ import static java.lang.invoke.MethodHandles.lookup;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class Upcalls extends CLayouts {
|
||||||
|
|
||||||
static final Linker abi = Linker.nativeLinker();
|
static final Linker abi = Linker.nativeLinker();
|
||||||
|
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Warmup(iterations = 3, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Warmup(iterations = 3, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
||||||
@Fork(3)
|
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" })
|
||||||
@State(Scope.Benchmark)
|
@State(Scope.Benchmark)
|
||||||
public class PointerBench {
|
public class PointerBench {
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class PointsAccess {
|
||||||
|
|
||||||
BBPoint BBPoint;
|
BBPoint BBPoint;
|
||||||
|
@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class PointsAlloc {
|
||||||
|
|
||||||
@Benchmark
|
@Benchmark
|
||||||
|
@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class PointsDistance {
|
||||||
|
|
||||||
BBPoint jniP1;
|
BBPoint jniP1;
|
||||||
|
@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
@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 {
|
public class PointsFree {
|
||||||
|
|
||||||
JNIPoint jniPoint;
|
JNIPoint jniPoint;
|
||||||
|
@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
|
||||||
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
@State(org.openjdk.jmh.annotations.Scope.Thread)
|
||||||
@OutputTimeUnit(TimeUnit.MILLISECONDS)
|
@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 {
|
public class XorTest {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user