Skip to content

Add precompilation workload for Shooting methods - #400

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:precompile-improvements-20251230-045743
Dec 30, 2025
Merged

Add precompilation workload for Shooting methods#400
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:precompile-improvements-20251230-045743

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

Add PrecompileTools-based precompilation for BoundaryValueDiffEqShooting to reduce time-to-first-execution (TTFX) for Shooting and MultipleShooting solvers.

Changes

  • Add PrecompileTools, Preferences, and OrdinaryDiffEqTsit5 as dependencies
  • Add @setup_workload and @compile_workload blocks that precompile:
    • Shooting solver with Tsit5 ODE solver
    • MultipleShooting solver with 5 shooting points
    • Both in-place and out-of-place problem formulations
    • Both standard BVProblem and TwoPointBVProblem variants

Timing measurements (Julia 1.12)

Before:

  • Package load time: ~7.5-8 seconds
  • TTFX for Shooting: ~10 seconds (compile overhead: ~9.8s)
  • TTFX for MultipleShooting: similar

After:

  • Package load time: ~8 seconds (unchanged)
  • TTFX for Shooting: ~8 seconds (compile overhead: ~8s)
  • Precompilation time: ~52s (from ~9s before)

Notes

  • The 20% TTFX improvement is modest due to Julia's function specialization - user-provided functions always require some compilation
  • Preferences can be used to disable precompilation if desired:
    • PrecompileShooting (default: true)
    • PrecompileMultipleShooting (default: true)
  • No invalidations from BoundaryValueDiffEq code were found (176 invalidation trees exist but all from dependencies)
  • MIRK and FIRK subpackages already had precompilation workloads; this adds the same for Shooting

Test plan

  • All BoundaryValueDiffEqShooting tests pass (189 passed, 1 JET test failed - pre-existing issue)
  • Measured TTFX improvement with precompilation

cc @ChrisRackauckas

🤖 Generated with Claude Code

Add PrecompileTools-based precompilation for BoundaryValueDiffEqShooting
to reduce time-to-first-execution (TTFX) for Shooting and MultipleShooting
solvers.

Changes:
- Add PrecompileTools, Preferences, and OrdinaryDiffEqTsit5 as dependencies
- Add @setup_workload and @compile_workload blocks that precompile:
  - Shooting solver with Tsit5 ODE solver
  - MultipleShooting solver with 5 shooting points
  - Both in-place and out-of-place problem formulations
  - Both standard BVProblem and TwoPointBVProblem variants

Timing improvements (measured on Julia 1.12):
- Shooting TTFX reduced from ~10s to ~8s (20% improvement)
- Precompilation time increases from ~9s to ~52s (acceptable tradeoff)

Preferences can be used to disable precompilation if desired:
- PrecompileShooting (default: true)
- PrecompileMultipleShooting (default: true)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas
ChrisRackauckas merged commit a2fbe1d into SciML:master Dec 30, 2025
10 of 18 checks passed
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.

3 participants