Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance degradation in evaluation of SpelExpression with access to Map [SPR-11388] #16015

spring-projects-issues opened this issue Feb 4, 2014 · 1 comment


Copy link

@spring-projects-issues spring-projects-issues commented Feb 4, 2014

Spenson Shih opened SPR-11388 and commented

Starting in spring 4.0, evaluating SpEL expressions with map access has suffered severe performance degradation.

The code snippet below is used to demonstrate:

Map<String, String> map = new HashMap<String, String>();
map.put("key", "value");
EvaluationContext context = new StandardEvaluationContext(map);

ExpressionParser spelExpressionParser = new SpelExpressionParser();
Expression expr = spelExpressionParser.parseExpression("#root['key']");

StopWatch s = new StopWatch();
for (int i = 0; i < 10000; i++) {

Using Spring 3.x, average time is 50ms. Upon upgrade to Spring 4.0, average time is 1000ms. Spring 4.0.1 is slightly better at 700ms.

Affects: 4.0 GA, 4.0.1

Referenced from: commits 7efd54e

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 14, 2014

Juergen Hoeller commented

MapAccessTests.testGetValueFromRootMap is basically this one, for a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants