thymeleaf/thymeleaf — pull request #318 by jkuipers (2014-10-10 15:42:48+00:00)
Title: Cache request attribute names in WebVariablesMap

I noticed that the WebVariablesMap is called hundreds or even thousands of times for a single request (esp. containsKey()) in a way that requires getting the attribute names from the HTTP servlet request. This becomes rather expensive, as new HashMap is created and populated for that on every request.
I've patched it to cache request attributes, and my initial profiling results indicates that this can save a very significant amount of time during rendering.

Could you please review my changes and, if possible, check if you're seeing speed improvements as well?