On Thu, 15 May 2025 09:49:10 GMT, Per Minborg <pminb...@openjdk.org> wrote:

> This PR improves the robustness of tests on slow machines such as "zero" 
> variants. The timeout was increased to 10 minutes for both tests. There are 
> many combinations in `TestAccessModes`, so the test takes some time even on a 
> fast machine. In `StdLibTest`, there are numerous native calls, and these can 
> be much slower on "zero" machines. In the latter test class, I made some 
> attempts to improve performance. On my M1 machine, the test was about 10% 
> faster with the changes (but I only did one run, so this might be in the 
> error margin).

test/jdk/java/foreign/StdLibTest.java line 56:

> 54:     static final Linker abi = Linker.nativeLinker();
> 55: 
> 56:     private static final StdLibHelper STD_LIB_HELPER = new StdLibHelper();

The `STD_LIB_HELPER` is now a constant.

test/jdk/java/foreign/StdLibTest.java line 145:

> 143:     static final class StdLibHelper {
> 144: 
> 145:         static final MethodHandle strcat = 
> abi.downcallHandle(abi.defaultLookup().findOrThrow("strcat"),

Drive-by cleanup to blessed order.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25248#discussion_r2090771644
PR Review Comment: https://git.openjdk.org/jdk/pull/25248#discussion_r2090769634

Reply via email to