Skip to content

Cache the annotation-driven converters created from a AnnotationFormatterFactory to improve performance [SPR-7104] #11764

Closed
@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-7104 and commented

Currently FormattingConversionService delegates to an AnnotationFormatterFactory on every conversion attempt to obtain the Printer or Parser to print/parse an annotated-field value, respectively. This is a bit inefficient, especially since each invocation also results in generic type introspection against the Printer/Parser instance.

We can improve performance by caching by Annotation + field type. So when the same annotation with the same attributes is found for the same field type across different fields, we'd still resolve the same (cached) Printer/Parser instance.


Affects: 3.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions