Skip to content

Avoid parsing nested jar URLs for cached resource lookups - #51827

Open
sharanrenukeshbharmshetty wants to merge 1 commit into
spring-projects:mainfrom
sharanrenukeshbharmshetty:sharan-first-contribution
Open

sharanrenukeshbharmshetty wants to merge 1 commit into
spring-projects:mainfrom
sharanrenukeshbharmshetty:sharan-first-contribution

Conversation

@sharanrenukeshbharmshetty

Copy link
Copy Markdown

Construct JarFileUrlKey directly from already-parsed URL specification to avoid unnecessary URL construction and parsing on cache hits. A URL is only created on a cache miss when the JarFile needs to be instantiated.

This eliminates redundant object allocation in the hot path when frameworks probe for optional classes or package-info metadata across a large executable JAR.

Closes gh-51503

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 17, 2026
Construct JarFileUrlKey directly from already-parsed URL specification
to avoid unnecessary URL construction and parsing on cache hits.
A URL is only created on a cache miss when the JarFile needs to be
instantiated.

This eliminates redundant object allocation in the hot path when
frameworks probe for optional classes or package-info metadata across
a large executable JAR.

Closes spring-projectsgh-51503

Signed-off-by: sharanrenukeshbharmshetty <sbharmshetty@gmail.com>
@philwebb philwebb self-assigned this Sep 17, 2026
@philwebb philwebb added type: enhancement A general enhancement theme: performance Issues related to general performance and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2026
@philwebb philwebb added this to the 4.2.x milestone Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme: performance Issues related to general performance type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid parsing nested jar URLs for cached resource lookups

3 participants