On Tue, 11 Aug 2026 10:23:29 GMT, Claes Redestad <[email protected]> wrote:

>> This PR splits the JDK build of microbenchmarks into two passes, one which 
>> builds with `--enable-preview` and the other without. As the micros which 
>> currently needs to be built with preview are contained in only two packages 
>> I've opted for the minimalist solution of listing those in the makefile. A 
>> future enhancement might be to add some annotation-driven discriminator but 
>> this seems like overkill to me. 
>> 
>> Also drive-by adjusted an error in the documentation of SetupJavaCompilation 
>> (package names to INCLUDES / EXCLUDES should be provided with slashes, not 
>> dots) and removed `--enable-preview` from a couple of microbenchmarks which 
>> no longer need it. 
>> 
>> One glaring limitation of a split-build approach is that code in each group 
>> can no longer overlap or share code. As microbenchmarks are typically 
>> self-contained this currently isn't and shouldn't become much of an issue. 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Claes Redestad has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Remove excess newline

make/test/BuildMicrobenchmark.gmk line 132:

> 130:     SRC := $(MICROBENCHMARK_SRC), \
> 131:     BIN := $(MICROBENCHMARK_CLASSES), \
> 132:     JAVAC_FLAGS := \

I think we might want to extract disabled warnings, javac flags, and java flags 
to another variable, and we can add the `preview` and `--enable-preview` flags 
for the disabled warnings and javac flags.

make/test/BuildMicrobenchmark.gmk line 153:

> 151:         --add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
> 152:         --add-modules jdk.unsupported \
> 153:         --enable-preview \

I actually wonder if JMH actually need this flag at all...

make/test/BuildMicrobenchmark.gmk line 157:

> 155: ))
> 156: 
> 157: $(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS)

Maybe add a line:

$(BUILD_JDK_MICROBENCHMARK_PREVIEW): $(JMH_COMPILE_JARS)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32296#discussion_r3758140074
PR Review Comment: https://git.openjdk.org/jdk/pull/32296#discussion_r3757950098
PR Review Comment: https://git.openjdk.org/jdk/pull/32296#discussion_r3758119010

Reply via email to