-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize GenericConversionService.findConverterForClassPair [SPR-6749] #11415
Comments
Keith Donald commented The overhead of processing the same interfaces multiple times is illustrated by the following trace logging when converting a String[] array to a LinkedList:
|
Rossen Stoyanchev commented A second point to be made is that when a superclass is added, its interface hierarchy will likely be a subset (and hence overlap) with the interface hierarchy of the current class. |
Keith Donald commented Now in addition to caching converter resolution results we track interfaces we've already attempted so we don't try the same interface again for a given sourceType and sourceType->targetType match. |
Oliver Becker opened SPR-6749 and commented
The method findConverterForClassPair in GenericConversionService checks interfaces unnecessarily multiple times. This will lead to a performance penalty if no converter can be found.
The point is that addInterfaceHierarchy() adds the entire interface hierarchy to the classQueue (which was done for fixing #10963). However for every processed interface in the queue its entire hierarchy is appended to queue again. In the end a base interface of a multi-level interface hierarchy will be processed multiple times.
Affects: 3.0 GA
This issue is a sub-task of #10963
Issue Links:
Referenced from: commits ad93d20
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: