Cache duration Pattern in GenerationalHeapParser CMS remark path - #579
Conversation
Compile DURATION_GROUP_PATTERN once as a static final field instead of on every CMS remark weak-reference split parse call. Fixes microsoft#567.
Replace greedy .* with a line bounded prefix so matcher.find still selects the last pause time. Guard null parse results that SonarCloud flags as reliability bugs.
|
|
I ran JAIPilot Cloud against this exact PR head. It found one additional internal allocation cleanup in the changed ParNew promotion-failure path: collect sizes in a growable primitive int array instead of boxing each value into an ArrayList and then unboxing into the final array. Tests pin zero, one, and 28 captured blocks and their exact order. The same focused and 124 parser tests passed before and after; the seven-module reactor passed. A fixed 28-block collection fixture eliminated 28 boxed Integers plus ArrayList growth, with a five-trial isolated median of 733.82 ms to 537.30 ms over 5,000,000 iterations. PR directly onto this source branch: Hashim1999164#1 Regex parsing dominates real log processing and the populated field currently has no downstream reader, so this is an optional internal allocation cleanup rather than a broad throughput claim. Microsoft CLA handling may require folding the change into the contributor commit. |
|
John (@johnoliver) Can you approve and merge |



Summary
splitRemarkReferenceWithWeakReferenceSplitBugrecompiledPattern.compile(".* " + PAUSE_TIME)on every call. That matches other parser patterns that already usestatic finalcompiled patterns.This change introduces
DURATION_GROUP_PATTERNand reuses it for matching.Fixes #567
Test plan
./mvnw -pl parser -am -DskipTests compile