Skip to content

Performance - hashCode method of AbstractFallbackTransactionAttributeSource.DefaultCacheKey doesn't take targetClass into account [SPR-12536] #17141

Closed
@spring-projects-issues

Description

@spring-projects-issues

Victor Bronstein opened SPR-12536 and commented

In commit 57eedf3 Juergen Hoeller has simplified the hashCode function of this class to use the method only and ignore the targetClass field. This causes a performance degradation because all methods inherited from java.lang.Object map to the same hash (thus falling into the same bucket) but return false when compared (targetClass differs). Therefore the price of getting a value from the attributeCache rises considerably which given the enormous amount of calls to getTransactionAttribute creates a performance degradation.


Affects: 3.2.7, 4.1.3

Issue Links:

Backported to: 4.0.9, 3.2.13

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions