Skip to content

Precompute PropertyDescriptor array in SimpleBeanInfoFactory #36112

@sbrannen

Description

@sbrannen

In SimpleBeanInfoFactory, we currently create a new array PropertyDescriptor array every time getPropertyDescriptors() is invoked on the SimpleBeanInfo created by the factory.

As a minor enhancement, if we precompute the array we can reduce the memory footprint of such BeanInfo instances (since they'll no longer retain a reference to the Collection which in turn retains a reference to a no-longer-needed TreeMap). In addition, repeated invocations of getPropertyDescriptors() will be slightly faster.

Metadata

Metadata

Assignees

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