[ 
https://issues.apache.org/jira/browse/GROOVY-12133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18093786#comment-18093786
 ] 

ASF GitHub Bot commented on GROOVY-12133:
-----------------------------------------

github-actions[bot] commented on PR #2669:
URL: https://github.com/apache/groovy/pull/2669#issuecomment-4885427675

   ### JMH summary — classic (commit `917d343`)
   
   Speedup vs trailing 90-day baseline on gh-pages. Higher = faster.
   `1.00` = in line with history. Per-benchmark ratio, geomean within group.
   Time-per-op units inverted so direction is consistent. The *calibrated*
   column divides out this runner's speed vs the baseline hardware, as
   measured by Groovy-independent pure-Java ruler benchmarks.
   
   | Group  | Speedup | Calibrated | n |
   |--------|---------|------------|---|
   | bench | 1.025 × | 0.986 × | 78 |
   | core | 1.031 × | 1.099 × | 77 |
   | grails | 0.995 × | 0.975 × | 80 |
   
   <sub>Runner calibration (this run vs baseline hardware): bench 1.03× (26 
rulers) · core-ag 0.89× (3 rulers) · core-hz 1.00× (3 rulers) · grails-ad 0.89× 
(3 rulers) · grails-ez 1.14× (3 rulers)</sub>
   
   <sub>Baseline: <code>dev/bench/jmh/&lt;part&gt;/classic/data.js</code> on 
gh-pages, trailing 90 days. <a 
href="https://apache.github.io/groovy/dev/bench/jmh/summary.html";>Daily 
dashboard</a> · <a 
href="https://apache.github.io/groovy/dev/bench/jmh/";>Per-suite raw 
data</a></sub>
   
   <!

> Implement matchBalanced utility to support Regex Balanced Groups
> ----------------------------------------------------------------
>
>                 Key: GROOVY-12133
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12133
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>             Fix For: 6.0.0-beta-1
>
>
> *Context*
> Java's native regex engine lacks C#-style balanced group support (pushdown 
> automaton). This makes parsing infinitely nested structures (e.g., nested 
> parentheses, HTML tags, or code blocks) notoriously difficult, often leading 
> to ReDoS (Regular Expression Denial of Service) vulnerabilities if solved 
> purely via regex.
> *Proposed Solution*
> Introduce a highly optimized {{matchBalanced}} method. It should use a 
> single-pass, stack-based scanner with dynamic subsumption (tail-absorption) 
> to mimic C# balanced group behavior while guaranteeing O(N) performance.
> *Acceptance Criteria*
>  * *Core Extraction:* Correctly extracts the outermost balanced groups from 
> deeply nested strings (e.g., {{(A + (B * C))}} extracts the entire block).
>  * *Fault Tolerance:* Gracefully handles malformed/dangling boundaries 
> (unmatched open or close tags) without polluting the stack or crashing.
>  * *Ignore Options:* Supports an {{ignoreRegex}} configuration to safely 
> bypass escaped boundaries or string literals (e.g., ignoring {{"{}"}} inside 
> quotes).
>  * *Edge Stripping:* Supports an {{includeEdges}} configuration to optionally 
> strip the outer boundary tags from the result.
>  * *Performance:* Must guarantee strict O(N) time complexity. No 
> backtracking, recursion, or expensive sorting operations are allowed.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to