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

Avoid repeated calls to getPathWithinApplication from UrlPathHelper.getLookupPathForRequest #25669

Closed
LukeButters opened this issue Aug 31, 2020 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@LukeButters
Copy link

After looking at:
Screenshot_20200901_084804
I think an easy optimisation exists UrlPathHelper.getLookupPathForRequest(HttpServletRequest).

I notice that it calls getPathWithinServletMapping which calls getPathWithinApplication, later it decides it is not happy with the result and so calls getPathWithinApplication again.

I suspect it should be easy enough to change getLookupPathForRequest to first call getPathWithinApplication then pass that into getPathWithinServletMapping, if that doesn't return a satisfactory result return the already computed value of: getPathWithinApplication

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 31, 2020
@jhoeller jhoeller self-assigned this Sep 1, 2020
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 1, 2020
@jhoeller jhoeller added this to the 5.2.9 milestone Sep 1, 2020
@jhoeller jhoeller changed the title Easy optimisation for org.springframework.web.util.UrlPathHelper.getLookupPathForRequest(HttpServletRequest) Avoid repeated calls to getPathWithinApplication from UrlPathHelper.getLookupPathForRequest Sep 1, 2020
@LukeButters
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants