Skip to content
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

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

Merged
merged 1 commit into from Dec 6, 2019

Conversation

stsypanov
Copy link
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.

None yet

3 participants