Lari Hotari opened SPR-8283 and commented
The performance of ServletContextResourceLoader.getResource is very bad because it creates a MalformedURLException in normal operation.
I've noticed this problem in Grails webapplications.
Creating exceptions are costly because filling the stack trace of the exception takes relatively a lot of cpu.
There should be a better way to check url validity (without exceptions). In commons-validator there is org.apache.commons.validator.routines.UrlValidator , but I guess a simple check in ServletContextResourceLoader.getResource should be ok. (if path starts with '/' , prefer getResourceByPath)
Affects: 3.0.5
Referenced from: commits f388408