Skip to content

#46 Consolidate redundant ClassGraph scans during Element loading - #72

Merged
krh372 merged 1 commit into
mainfrom
feature/46-consolidate-classgraph-scans
Aug 27, 2026
Merged

#46 Consolidate redundant ClassGraph scans during Element loading#72
krh372 merged 1 commit into
mainfrom
feature/46-consolidate-classgraph-scans

Conversation

@krh372

@krh372 krh372 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • DefaultElementLoaderFactory ran ~11 independent ClassGraph scans per Element load: 5 package-scoped scans (services, produced events, consumed events, default attributes, required attributes), each also triggering its own unrestricted probe scan via rejectOtherElementPackages, plus the initial module-definition scan.
  • Consolidated down to 3 scans: the module-definition scan (unavoidably unrestricted, since the element's package isn't known yet), a single reject-list probe (findOtherElementPackageNames, computed once instead of once per extraction), and one shared enableAllInfo() scan (scanElementPackage) that all five metadata extractions now read from instead of each re-scanning.
  • No behavior change — enableAllInfo() is a strict superset of every info-flag combination the 5 original scans requested individually.

Fixes #46

Test plan

  • mvn -pl sdk-spi -am install — compiles cleanly
  • mvn -pl sdk-test test — 27/27 tests pass, including ElementLoaderTest, ApiElementLoaderTest, FlatElementPathLoaderTest, which exercise the full isolated-classloader element-loading pipeline (services, produced/consumed events, default/required attributes) against real test-element fixtures
  • mvn -pl sdk-spi-guice test — 3/3 tests pass
  • Manual smoke test against a running jetty-ws instance

DefaultElementLoaderFactory ran ~11 independent ClassGraph scans per element
load: 5 package-scoped scans (services, produced events, consumed events,
default attributes, required attributes), each also triggering its own
unrestricted probe scan via rejectOtherElementPackages, plus the initial
module-definition scan. Consolidated into 3: the module-definition scan, a
single reject-list probe (findOtherElementPackageNames), and one shared
enableAllInfo() scan (scanElementPackage) that all five metadata extractions
now read from instead of re-scanning.
@krh372 krh372 self-assigned this Aug 26, 2026
@krh372
krh372 requested a review from ptwohig August 26, 2026 20:38
@krh372
krh372 merged commit 7759479 into main Aug 27, 2026
1 check passed
@krh372
krh372 deleted the feature/46-consolidate-classgraph-scans branch August 27, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache/consolidate redundant ClassGraph scans during Element loading

2 participants