RFR: 8274166: Some CDS tests ignore -Dtest.cds.runtime.options [v4]
Matias Saavedra Silva
matsaave at openjdk.org
Wed Apr 5 16:51:25 UTC 2023
On Wed, 5 Apr 2023 01:52:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fixed indentation and removed unused imports
>
> test/lib/jdk/test/lib/cds/CDSTestUtils.java line 624:
>
>> 622:
>> 623: public static boolean isGCOption(String s) {
>> 624: return s.startsWith("-XX:+Use") && s.endsWith("GC");
>
> Nit: maybe `s.matches` with a suitable regex would be more effecient?
>From my understanding, `s,startsWith("X") && s.endsWith("Y")` is faster than using regex as the regex API requires a pattern to be compiled and then matched. With the size of an argument list and the short length of each string, I think this would be the faster option. This also removes the need to import more libraries and hold a static variable for the Pattern.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13273#discussion_r1158775111
More information about the hotspot-runtime-dev
mailing list