Affects: 5.2 Type: Bug

SpringFramework 5.2 has a regression in CPU performance when dealing with RequestParameters with default values in combination with having a Filter that looks at the HttpServletRequest & HttpServletResponse (AccessLogging). The impact on CPU is massive when upgrading from 5.1 to 5.2.

I replicated the behaviour here https://github.com/jensim/spring-boot-compare-22-21

@philwebb @jhoeller @sbrannen

Comment From: jhoeller

@sbrannen Could you please have a look at this as well while you're in the area with #24861 already...

Comment From: sbrannen

@jensim in light of the fix for #24970, could you please try out a 5.2.6 snapshot build to see if that improves the situation for you?

Looking forward to your feedback!

Comment From: jensim

Big thanks @sbrannen for looking at this I did some new testruns with 5.2.6-BUILD-SNAPSHOT, and documented it in my demo-repo. Basically it's a lot better than 5.2.5.RELEASE, and should no longer be blocking us from upgrading our applications. 5.2.6.BUILD-SNAPSHOT Its still a noticeable regression over 5.1, if you are looking for it.

But, the lesson we take away from it at my company is not to have this many request-params on a GET request just because the verb is semantically more correct. A POST with a body is A LOT more efficient CPU/speed-wise in spring.

Comment From: sbrannen

I've marked this issue as superseded by #24970.

Big thanks @sbrannen for looking at this

You're welcome.

I did some new testruns with 5.2.6-BUILD-SNAPSHOT, and documented it in my demo-repo . Basically it's a lot better than 5.2.5.RELEASE, and should no longer be blocking us from upgrading our applications.

Great. Very glad to hear that.

And... thank for providing the feedback!

Its still a noticeable regression over 5.1, if you are looking for it.

We are indeed considering other ways to improve the performance of our annotation processing.

But, the lesson we take away from it at my company is not to have this many request-params on a GET request just because the verb is semantically more correct. A POST with a body is A LOT more efficient CPU/speed-wise in spring.

Any time you have that many request parameters in a single controller method it's good to investigate whether it would be better to bind them all to a single "command object" (@ModelAttribute) or to submit them as the request body (@RequestBody).

Comment From: sbrannen

Its still a noticeable regression over 5.1, if you are looking for it.

We are indeed considering other ways to improve the performance of our annotation processing.

See #24981