Skip to content

Hoist Class.getName() from String concatenation to dodge an issue related to profile pollution#24153

Merged
jhoeller merged 1 commit intospring-projects:masterfrom
stsypanov:polution
Dec 6, 2019
Merged

Hoist Class.getName() from String concatenation to dodge an issue related to profile pollution#24153
jhoeller merged 1 commit intospring-projects:masterfrom
stsypanov:polution

Conversation

@stsypanov
Copy link
Copy Markdown
Contributor

On one of my projects I've run into performance issue related to profile polution when Class.getName() is used inside of String concatenation chain. The issue is described here: https://stackoverflow.com/questions/59157085/java-8-class-getname-slows-down-string-concatenation-chain

As far as Spring is likely to remain on Java 8 code base I suggest to hoist Class.getName() from frequently executed concatenation chains at least from ObjectUtils.identityToString() which is called from loop in DefaultListableBeanFactory.findAutowireCandidates() and SimpleTraceInterceptor.getInvocationDescription().

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 6, 2019
@jhoeller jhoeller self-assigned this Dec 6, 2019
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 6, 2019
@jhoeller jhoeller added this to the 5.2.3 milestone Dec 6, 2019
@jhoeller jhoeller merged commit 484006c into spring-projects:master Dec 6, 2019
@stsypanov stsypanov deleted the polution branch December 6, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants