Skip to content

Conversation

@lprimak
Copy link
Contributor

@lprimak lprimak commented Jan 21, 2025

Deploy performance improvements

This is an experiment (for now)

This PR achieves at least 2X improvement when dependencies are not cached, which is a worst-case scenario.
I have seen as much as 5X performance improvement on a warmed-up JVM with dependencies cached,
with many dependencies.

Feedback is appreciated

Thank you.

Fixes #7079

  • Save jandex to transient metadata
  • Refactor HK2-Types stuff in WeldUtils into separate file
  • Use Jandex in addition to Types in WeldUtils (get jandex-based WAR to deploy) - ignoring dependencies for now
  • How does Scanner / Parser parse war-libraries? - what's the calling flow? - in ApplicationLifecycle (kernel)
  • Save / cache Types or use Jandex for dep libs? - Jandex
  • Index (via Jandex)
  • Index via Jandex - WAR dependencies
  • Restore shared WARlib functionality
  • Cache Jandex indexes in the domain - file cache on disk
  • Load Jandex from cache, if exists
  • Does old scanner get invoked for WARlibs? - No, scanner doesn't get invoked for warlibs
  • DOL Factory using Jandex
  • WarScanner using Jandex
  • EAR support (DOL module, etc)
  • Do not cache -SNAPSHOT dependencies
  • DOL: remove handler stack, make it no-op
  • Sync w/main branch
  • Profile the code, see where the bottlenecks actually are
  • Check default context push / pop
  • Re-introduce parallel scanning. Hopefully causes much more performance improvement
  • Delay writing jandex cache to disk until after deployment
  • Check for file leaks
  • Check for ClassLoader leaks
  • Check new SpringBoot-related code and remove types from there / cc: @Pandrex247
  • Emailmanager doesn't deploy on remote container
  • Remove AnnotationClassModel and use Jandex-based model directly
  • Test / fix issue-reproducers/cdi-unknownbda reproducer
  • Do not cache exploded WARs / JARs
  • Get FlowLogix tests to work
  • WeldUtils - cache CDI results in context, per-index
  • Check old lifecycle to see if anything is missing that needs to be restored
  • Remove APF/hk2 folders (old lifecycle)
  • Reintroduce StructuredDeploymentTracing tracing = StructuredDeploymentTracing.load(context);
  • Reintroduce tracing.startSpan(DeploymentTracing.AppStage.CLASS_SCANNING, source.getName()); for each source
  • Reintroduce getExternalLibraries() into Lifecycle
  • Reintroduce DeploymentProperties.SKIP_SCAN_EXTERNAL_LIB support
  • Remove TODOs
  • Look at GenericAnnotationDetector to see if it's getting used anywhere / use Jandex for it
  • Get current test to deploy (duplicate classes in root EAR vs. EJB-JAR
  • Code cleanup
  • Get tests to pass again

@lprimak lprimak changed the title [WIP] Replace HK2/Types with Jandex and cache in the domain [WIP] Replace HK2/Types/Parser/Scanner with Jandex and cache in the domain Jan 21, 2025
@lprimak
Copy link
Contributor Author

lprimak commented Jun 15, 2025

Update on the progress:

Dependencies of this issue ballooned from a 3-day project to a 8-month behemoth. What this means is that I won't have any time to work on this til probably 2026 or later.
I am going to put this work on hold to more concentrate on some strategic things that I need to do.
If anyone is interested to accelerate this work, please contact me to discuss.

Just to reiterate, I am not going abandon this (I never abandon anything) but currently the timing is not in this task's favor.
What this means is probably will go into Payara 7 only

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.

Enhancement: Payara should use Jandex to speed up CDI deployments

2 participants