DATACMNS-1357 - Use shared DefaultConversionService in ProxyProjectionFactory and ResultProcessor.

ProxyProjectionFactory and ResultProcessor require a DefaultConversionService to convert values for projection proxies and to post-process query method results. Creating instances of these types requires an instance of the conversion service which previously created a DefaultConversionService instance (along all converter registrations) upon ProxyProjection/ResultProcessor instantiation.

We now use the shared instance that is initialized once and shared across all ProxyProjection/ResultProcessor instances to reduce garbage and improve the CPU profile.
This commit is contained in:
Mark Paluch
2018-07-25 15:31:45 +02:00
parent 31a08254a7
commit ea8cf8c629
2 changed files with 3 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
*
* @author Oliver Gierke
* @author Christoph Strobl
* @author Mark Paluch
* @see SpelAwareProxyProjectionFactory
* @since 1.10
*/
@@ -60,7 +61,7 @@ class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware
this.factories.add(MapAccessingMethodInterceptorFactory.INSTANCE);
this.factories.add(PropertyAccessingMethodInvokerFactory.INSTANCE);
this.conversionService = new DefaultConversionService();
this.conversionService = DefaultConversionService.getSharedInstance();
}
/*