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

feat: Optimize DatabaseDriver fromJdbcUrl method with caching #43637

Closed
wants to merge 1 commit into from

Conversation

minwoo1999
Copy link
Contributor

This PR introduces a cache (URL_PREFIX_CACHE) to store URL prefixes for all DatabaseDriver enums. By precomputing prefixes during initialization, the fromJdbcUrl method avoids redundant calls to getUrlPrefixes, significantly improving performance for repeated lookups.

Caching was chosen to reduce computational overhead while keeping the code maintainable. Future updates to getUrlPrefixes automatically reflect in the cache, requiring no additional changes.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 30, 2024
@minwoo1999 minwoo1999 closed this Dec 30, 2024
@philwebb philwebb added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants