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
Share MethodParameter cache between HandlerMethods [SPR-9748] #14382
Comments
Patrick Linskey commented GitHub commit for 3.1.1: pcl@15a9eee Note that this and #14381 both contain edits to HandlerMethod. The GitHub commits above are applied on top of the #14381 patch; applying them out-of-order might take some manual tweaking. './gradlew build' succeeds with this patch on master. I'm still trying to figure out how to get 3.1.1 to build on my machine (http://forum.springsource.org/showthread.php?129846-Spring-3-1-1-compilation&p=423733#post423733) |
Patrick Linskey commented FYI, this eliminates 2.1% of the CPU burn in my Spring-MVC app. |
Patrick Linskey commented On closer inspection, this eliminates 4.2% of the CPU burn. |
Rossen Stoyanchev commented This should now be resolved although using a slightly different approach. Here is the commit with the changes. It has also been applied to 3.1.x (and will be in 3.1.3) with a few other changes. Note however that currently there are (unrelated) build failures in both master and 3.1.x, so no snapshots are available yet. Thanks for raising this issue! |
Patrick Linskey commented Looks good... and incidentally, this fix might resolve a follow-on optimization that we noticed around ServletInvocableHandlerMethod. I'll try these out once a snapshot for 3.1.3 is available and see what the impact is. Thanks! |
Patrick Linskey opened SPR-9748 and commented
RequestMappingHandlerAdapter creates a new HandlerMethod for each request. HandlerMethods cache their MethodParameters to avoid costly reflection calls each time annotation stats are needed, but the per-request copy circumvents this cache. This patch explicitly copies the MethodParameter cache from a HandlerMethod and its request-scoped dependents.
Affects: 3.1.1, 3.1.2, 3.2 M2
Issue Links:
Referenced from: commits 2295372, 0a877af
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: