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

Config$Key.unescapeName() performance optimizations #9430

Closed
brian-maulding opened this issue Oct 24, 2024 · 1 comment · Fixed by #9448
Closed

Config$Key.unescapeName() performance optimizations #9430

brian-maulding opened this issue Oct 24, 2024 · 1 comment · Fixed by #9448
Assignees
Labels
4.x Version 4.x config enhancement New feature or request
Milestone

Comments

@brian-maulding
Copy link

Environment Details

  • Helidon Version: 3.x and 4.x
  • Helidon SE and MP
  • JDK version: 21
  • OS: Linux
  • Docker version (if applicable):

Problem Description

Profiles of an application that frequently queries Config data shows significant time in io.helidon.config.Config$Key.unescapeName(). String.replaceAll() is used for simple string replacement (no regex) resulting in Pattern compilation and regex evaluation:

escapedName.replaceAll("~1", ".")
                    .replaceAll("~0", "~")

Using String.replace() will improve performance:

escapedName.replace("~1", ".")
                    .replace("~0", "~")
@romain-grecourt romain-grecourt added enhancement New feature or request config 4.x Version 4.x labels Oct 24, 2024
@romain-grecourt romain-grecourt added this to the 4.2.0 milestone Oct 24, 2024
@m0mus m0mus added the triage label Oct 24, 2024
@tomas-langer
Copy link
Member

This is correct, there is no need to use regular expression here, a simple string lookup is sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x config enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants