Skip to content

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

Merged
philwebb merged 2 commits into
spring-projects:mainfrom
sharanrenukeshbharmshetty:sharan-first-contribution
Sep 29, 2026
Merged

philwebb merged 2 commits into
spring-projects:mainfrom
sharanrenukeshbharmshetty:sharan-first-contribution

Conversation

@sharanrenukeshbharmshetty

Copy link
Copy Markdown
Contributor

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
@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
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.

See spring-projectsgh-51827

Signed-off-by: sharanrenukeshbharmshetty <sbharmshetty@gmail.com>
@philwebb
philwebb force-pushed the sharan-first-contribution branch from 8fad6eb to 8fc6a01 Compare September 29, 2026 02:36
@philwebb
philwebb merged commit ab1843b into spring-projects:main Sep 29, 2026
1 check failed
@philwebb philwebb modified the milestones: 4.2.x, 4.2.0-RC1 Sep 29, 2026
@philwebb

Copy link
Copy Markdown
Member

Thanks very much @sharanrenukeshbharmshetty!

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