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

Improve performance of StringUtils.capitalize() [SPR-15094] #19661

Closed
spring-projects-issues opened this issue Jan 4, 2017 · 0 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 4, 2017

Christoph Dreis opened SPR-15094 and commented

Hey,

just noticed a small possible improvement for (un-)capitalizing Strings. Using substring is rather expensive and we could avoid that. Please find my proposal attached.

|Benchmark|Mode|Cnt|Score|Error|Units|
|:---|
|MyBenchmark.testNew|thrpt|20|24027358,674|± 519677,096|ops/s|
|MyBenchmark.testOld|thrpt|20|16391178,671|± 378698,464|ops/s|

If no work has to be done I saw possible improvements of factor 20.

Cheers,
Christoph


Affects: 4.3.5

Referenced from: pull request #1285, and commits 31f7860, 83929b2, 5982f73

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.6 milestone Jan 11, 2019
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

No branches or pull requests

2 participants