Re: RFR 8225198 : Optimize regex tree for greedy quantifiers of type {N, }
Thank you Claes and Brent for reviewing! I'll edit the comment as suggested before pushing. And yes, we do have a few testcases to verify this optimization in RegExTest.java / BMPTestCases.txt. With kind regards, Ivan On 6/4/19 2:30 PM, Brent Christian wrote: Hi, Ivan The change looks fine. I would call this "noreg-cleanup". Tests are needed to confirm the correctness of the new code, which I imagine we already have. One small suggestion: src/java.base/share/classes/java/util/regex/Pattern.java 4271 * and unlimited maximum, for *, + and {N,} quantifiers. If the maximum is still MAX_REPS, I'd prefer to continue to say that (rather than, "unlimited.") Thanks. -Brent On 6/3/19 12:54 PM, Ivan Gerasimov wrote: Hello! When building a match-tree, the regex engine optimizes '*' and '+' greedy quantifiers by using special node of type CharPropertyGreedy. This later class can be used unmodified for other greedy quantifiers without the upper limit, i.e. of type '{N,}'. Would you please help review this simple optimization? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8225198 WEBREV: http://cr.openjdk.java.net/~igerasim/8225198/00/webrev/ (With the fix, one unused class was also removed. This class was to implement conditionals, which were never supported by Java regexs.) -- With kind regards, Ivan Gerasimov
Re: RFR 8225198 : Optimize regex tree for greedy quantifiers of type {N, }
Hi, Ivan The change looks fine. I would call this "noreg-cleanup". Tests are needed to confirm the correctness of the new code, which I imagine we already have. One small suggestion: src/java.base/share/classes/java/util/regex/Pattern.java 4271 * and unlimited maximum, for *, + and {N,} quantifiers. If the maximum is still MAX_REPS, I'd prefer to continue to say that (rather than, "unlimited.") Thanks. -Brent On 6/3/19 12:54 PM, Ivan Gerasimov wrote: Hello! When building a match-tree, the regex engine optimizes '*' and '+' greedy quantifiers by using special node of type CharPropertyGreedy. This later class can be used unmodified for other greedy quantifiers without the upper limit, i.e. of type '{N,}'. Would you please help review this simple optimization? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8225198 WEBREV: http://cr.openjdk.java.net/~igerasim/8225198/00/webrev/ (With the fix, one unused class was also removed. This class was to implement conditionals, which were never supported by Java regexs.)
Re: RFR 8225198 : Optimize regex tree for greedy quantifiers of type {N, }
Hi Ivan, looks good to me. /Claes On 2019-06-03 21:54, Ivan Gerasimov wrote: Hello! When building a match-tree, the regex engine optimizes '*' and '+' greedy quantifiers by using special node of type CharPropertyGreedy. This later class can be used unmodified for other greedy quantifiers without the upper limit, i.e. of type '{N,}'. Would you please help review this simple optimization? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8225198 WEBREV: http://cr.openjdk.java.net/~igerasim/8225198/00/webrev/ (With the fix, one unused class was also removed. This class was to implement conditionals, which were never supported by Java regexs.)
RFR 8225198 : Optimize regex tree for greedy quantifiers of type {N, }
Hello! When building a match-tree, the regex engine optimizes '*' and '+' greedy quantifiers by using special node of type CharPropertyGreedy. This later class can be used unmodified for other greedy quantifiers without the upper limit, i.e. of type '{N,}'. Would you please help review this simple optimization? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8225198 WEBREV: http://cr.openjdk.java.net/~igerasim/8225198/00/webrev/ (With the fix, one unused class was also removed. This class was to implement conditionals, which were never supported by Java regexs.) -- With kind regards, Ivan Gerasimov