boutss (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOTVjMjk4MDgy...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16129?atlOrigin=eyJpIjoiOTVjMj...
) HHH-16129 (
https://hibernate.atlassian.net/browse/HHH-16129?atlOrigin=eyJpIjoiOTVjMj...
) @Converter(autoapply=true) slow (
https://hibernate.atlassian.net/browse/HHH-16129?atlOrigin=eyJpIjoiOTVjMj...
)
Issue Type: Bug Affects Versions: 6.1.6 Assignee: Unassigned Attachments:
7a5ab3186e098aa7a9969079fa4d232c90568d77[1].png Components: hibernate-core Created:
02/Feb/2023 01:12 AM Environment: hibernate 6.1.6 / OpenJDK / Windows 11 / Oracle
Priority: Major Reporter: boutss (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
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 (
https://discourse.hibernate.org/t/converter-autoapply-true-slow/7215 )
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 (
https://github.com/alibaba/arthas )
The command to test :
monitor org.hibernate.boot.model.convert.internal.AttributeConverterManager
locateMatchingConverter -c 10
(
https://hibernate.atlassian.net/browse/HHH-16129#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16129#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100214- sha1:06410ea )