RFR: 8259074: regex benchmarks and tests [v2]

Martin Buchholz martin at openjdk.java.net
Tue Feb 2 01:16:07 UTC 2021


On Mon, 1 Feb 2021 00:23:56 GMT, Martin Buchholz <martin at openjdk.org> wrote:

>> test/micro/org/openjdk/bench/java/util/regex/Trim.java line 119:
>> 
>>> 117:         assert ! lookBehind_find();
>>> 118:         assert ! find_loop_two_matchers();
>>> 119:         assert ! find_loop_usePattern();
>> 
>> At a risk of muddling the profiles a bit, this can be rewritten as:
>> 
>>  if (!simple_find()) throw new IllegalStateException("simple_find is incorrect");
>>  ...
>
> Thanks Aleksey.  But I was hoping for something more magical.
> 
> We really want the checking of the result of the benchmark method to be co-located in the source code with the method, but with zero disturbance to the benchmark numbers.  Is such magic possible?

I refactored the correctness checking, no longer using the assert facility.

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

PR: https://git.openjdk.java.net/jdk/pull/1940


More information about the core-libs-dev mailing list