- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Reza Aliakbari opened SPR-3145 and commented
I got Spring 2.0.1 and I found a performance issue on this class that can slightly improve the performance of this object especially when there is a high load on this object.
On the method resolveViewName the code could be changed as follow
View view = (View) this.viewCache.get(cacheKey);
if (view == null) {
     synchronized (this.viewCache) {
          View view = (View) this.viewCache.get(cacheKey);
          if (view == null) {
           ......
          }
         .....
    }
}I also see the following comment // No synchronization, as we can live with occasional double caching. That is correct, but with the upper solution we don't need to be worry of extra object problem and also we have good performance.
Cheers,
Reza
Affects: 2.0.1
Issue Links:
- AbstractCachingViewResolver - caching redirect views leads to memory leak [SPR-10065] #14698 AbstractCachingViewResolver - caching redirect views leads to memory leak
Referenced from: commits 06c6cbb
1 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement