Skip to content

Consider caching the compiled pattern in OperatorMatches [SPR-12610] #17211

@spring-projects-issues

Description

@spring-projects-issues

Gary Russell opened SPR-12610 and commented

OperatorMatches invokes Pattern.compile() on the right operand on every invocation. This could be relatively expensive, especially with a complex regex, even with compiled SpEL.

In many cases, the regex will be a literal.

Consider caching (at least) the most recent compiled Pattern and reuse it if the right operand matches.


Affects: 4.1.4

Reference URL: http://stackoverflow.com/questions/19742528/spel-how-does-matches-work

Referenced from: commits d34402d, 87b7cd6

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions