Skip to content

Performance Issue with @ModelAttribute [SPR-15198] #19762

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jochen Pier opened SPR-15198 and commented

There is a possible performance problem:

If you use:

@ModelAttribute
public void before(@ModelAttribute(name="test") TestClass test) {
	test.setPayload("myPayload");
}

it is MUCH (10x) slower than the same

@ModelAttribute
public void before(Model model) {
	TestClass t = new TestClass();
	t.setPayload("myPayload");
	model.addAttribute("test", t);
}

This is true especially in high traffic situations and is constantly getting worse (slower) over the time.

I think, maybe a hint in the documentation will be a good idea. (Or maybe you can find the problem)

Do you need a test-project?


Affects: 4.3.5

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions