Skip to content

Improve classpath entry lookup performance during jar creation and extraction - #51787

Merged
wilkinsona merged 1 commit into
spring-projects:mainfrom
noojung:improve-indexedjarstructure
Sep 17, 2026
Merged

wilkinsona merged 1 commit into
spring-projects:mainfrom
noojung:improve-indexedjarstructure

Conversation

@noojung

@noojung noojung commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

IndexedJarStructure.resolve() is called for each archive entry during library extraction and application JAR creation. Each call checks classpath membership using ArrayList.contains(), which performs a linear scan.

Replace the ArrayList with a LinkedHashSet to provide average constant-time membership checks while preserving classpath order in the launcher manifest.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 16, 2026
@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2026
@wilkinsona wilkinsona added this to the 4.0.x milestone Sep 17, 2026
@wilkinsona wilkinsona self-assigned this Sep 17, 2026
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed type: task A general task labels Sep 17, 2026
@wilkinsona wilkinsona modified the milestones: 4.0.x, 4.2.0-M2 Sep 17, 2026
@wilkinsona wilkinsona changed the title Improve classpath entry lookup performance in IndexedJarStructure Improve classpath entry lookup performance during jar creation and extraction Sep 17, 2026
@wilkinsona

Copy link
Copy Markdown
Member

@noojung thanks for the PR. It was borderline whether I merged this as the benefit of the change vs the cost of merging it are in the balance. As with #51655, it's generally a better use of our time and yours to focus on contributions that address real-world problems or missing features that will have broad and noticeable benefit to as many of Boot's users as possible.

See spring-projectsgh-51787

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
@wilkinsona
wilkinsona force-pushed the improve-indexedjarstructure branch from 72fa3b1 to fabfdd5 Compare September 17, 2026 08:07
@wilkinsona
wilkinsona merged commit 254a2e3 into spring-projects:main Sep 17, 2026
4 checks passed
@noojung

noojung commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback.

I understand your point, and I’ll keep this in mind for future contributions and try to focus on changes that address broader real-world needs.

Thanks again for reviewing and merging the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants