David Mollitor created SPARK-59531:
--------------------------------------
Summary: Avoid a per-match MatchResult allocation in
regexp_extract, regexp_extract_all, and regexp_instr
Key: SPARK-59531
URL: https://issues.apache.org/jira/browse/SPARK-59531
Project: Spark
Issue Type: Improvement
Components: SQL
Affects Versions: 4.1.0
Reporter: David Mollitor
h2. Summary
{{{}RegExpExtractBase.extract{}}}, {{{}RegExpExtractBase.extractAll{}}}, and
{{RegExpInStr}} call {{Matcher.toMatchResult()}} on every match only to read
values that are already available on the {{Matcher}} itself.
{{toMatchResult()}} allocates an immutable snapshot of the match state
(including a copy of the groups {{{}int[]{}}}), so this is one throwaway
allocation per match on the {{{}regexp_extract{}}}, {{{}regexp_extract_all{}}},
and {{regexp_instr}} hot paths.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]