Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

  • Add PrecompileTools to precompile common code paths
  • Dramatically reduce time-to-first-X (TTFX) for key operations
  • Startup time remains roughly the same

Timing Improvements

Operation Before After Speedup
reduce!(pod, SVD()) [Vector{Vector}] 1.072s 0.024s 44x
reduce!(pod, TSVD()) 1.989s 0.020s 100x
reduce!(pod, RSVD()) 0.257s 0.021s 12x
reduce!(pod, SVD()) [Matrix] 0.034s 0.001s 34x
deim_interpolation_indices() 1.643s 0.0s instant

Startup time (~8s) remains similar.

Changes

  • Add PrecompileTools as a dependency with compat entry
  • Add src/precompilation.jl with @compile_workload that covers:
    • POD with matrix input + SVD algorithm
    • POD with Vector{Vector} input + TSVD algorithm
    • POD with RSVD algorithm
    • deim_interpolation_indices function

Notes

  • No invalidations originate from ModelOrderReduction itself
  • All 348 invalidation trees come from upstream dependencies (MutableArithmetics, JuliaSyntax, ChainRulesCore, etc.)
  • All tests pass

Test plan

  • Run Pkg.test() to verify package still works correctly
  • Measure TTFX improvements
  • CI passes

cc @ChrisRackauckas

🤖 Generated with Claude Code

This PR adds PrecompileTools to precompile common code paths, dramatically
reducing the time-to-first-X (TTFX) for key operations while maintaining
roughly the same startup time.

## Changes

- Add PrecompileTools as a dependency
- Add src/precompilation.jl with @compile_workload that covers:
  - POD with matrix input + SVD
  - POD with Vector{Vector} input + TSVD
  - POD with RSVD algorithm
  - deim_interpolation_indices

## Timing Improvements

| Operation | Before | After | Speedup |
|-----------|--------|-------|---------|
| reduce!(pod, SVD()) [Vector{Vector}] | 1.072s | 0.024s | 44x |
| reduce!(pod, TSVD()) | 1.989s | 0.020s | 100x |
| reduce!(pod, RSVD()) | 0.257s | 0.021s | 12x |
| reduce!(pod, SVD()) [Matrix] | 0.034s | 0.001s | 34x |
| deim_interpolation_indices() | 1.643s | 0.0s | instant |

Startup time remains similar (~8s).

No invalidations were found originating from ModelOrderReduction itself;
all invalidations come from upstream dependencies.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

2 participants