Hi, I opened a discussion on the forum about a performance issue using @AttributConverter(autoApply=true) which is much slower than using @RegistrationConverter which uses the domain type to reference a Converter @Converter(autoapply=true) slow - Hibernate ORM - Hibernate In my case I have 500 converters and 800 class attributes. For the performance we spend 30’000ms to apply the autoapply of the converters. If we use @ConversionRegister we are at 700 ms. Unfortunately I have no solution to propose to modify the code (see the .5).
- Retrieval of the type to apply the converter
- This is my solution which is faster, to exploit the registerConversionByDomainType
- The performance problem because we loop on all existing converters
- In addition to the time-consuming converter application test
- It is the verification that only one converter is compatible.
I tell myself that this is the reason why we loop over all the converters to make sure that we are not multiple compatible converters.
But in itself, we could know it upstream by using a map which also contains the type of the domain as a key. I use arthas for performance testing https://github.com/alibaba/arthas The command to test :
|