Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

Compare spring framework 5.1 and 5.2 CPU usage of getRequests with a ton of RequestParameters with default values

Notifications You must be signed in to change notification settings

jensim/spring-boot-compare-22-21

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compare CPU impact of Spring RequestParam on 5.1 vs 5.2

Build Status

Im trying to illustrate a very noticeable increase in CPU usage moving from v5.1 to v5.2 GET 2.1 with defaults GET 2.2 with defaults

We recently (tried to) upgrade one of our services in production, but rolled back once we noticed a rough doubling in CPU usage on the upgraded JVMs. The service in question handles a lot of requests, but doesn't do very much on its own, just some fanning out and collecting data from other services.

In this repo I've tried to set up two applications with as little stuff as possible, but to be fairly similar to the application that we upgraded in RequestParmeters.

We spent a ton of time trying to figure out what was wrong, JDK Mission Control pointed us at TypeMappedAnnotation.getValue(int,boolean,boolean). We are no spring experts, we only noticed it was new with SpringFramework 5.2. JMC

The CPU increase is roughly double, but only when we have an access logging filter active, otherwise the increase in CPU is less.

Conclusion

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.

5.2.6.BUILD-SNAPSHOT

Recordings made 2020-04-26. It looks like vast improvement over 5.2.5.RELEASE. 5.1.14.RELEASE 5.2.6.BUILD-SNAPSHOT

About

Compare spring framework 5.1 and 5.2 CPU usage of getRequests with a ton of RequestParameters with default values

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages