Add PrecompileTools workload to reduce time-to-first-X#131
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Add PrecompileTools workload to reduce time-to-first-X#131ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Timing Improvements
reduce!(pod, SVD())[Vector{Vector}]reduce!(pod, TSVD())reduce!(pod, RSVD())reduce!(pod, SVD())[Matrix]deim_interpolation_indices()Startup time (~8s) remains similar.
Changes
PrecompileToolsas a dependency with compat entrysrc/precompilation.jlwith@compile_workloadthat covers:Vector{Vector}input + TSVD algorithmdeim_interpolation_indicesfunctionNotes
Test plan
Pkg.test()to verify package still works correctlycc @ChrisRackauckas
🤖 Generated with Claude Code