Reduce blocking in Velocity when accessing cache

XMLWordPrintable

      Performance testing showed that up to 30% of threads at a time are blocked inside IntrospectorCacheImpl class inside velocity. This is a big bottleneck. We can improve the synchronization here by using better data structures (ConcurrentHashMap instead of synchronizing on the whole 'get' method). CPU snapshot reports that getPropertyGet takes 33% of overall execution time and Introspector.getMethod wich uses the same cache(ie. is blocked on the same synchronization block) takes 20% (on my machine).

      I have made some quick changes to velocity caching to get rid of synchronization where possible and run the tests.It decreased the average response time around 10-15% on my machine. I expect the improvement to be not so dramatic on the build box because I have database on the same box as confluence so there is very little IO time.

              Assignee:
              Anatoli
              Reporter:
              Anatoli
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: