Add PrecompileTools for improved startup time and TTFX#14
Merged
ChrisRackauckas merged 1 commit intoJan 2, 2026
Conversation
Add precompilation workloads using PrecompileTools.jl to dramatically
reduce startup time and time-to-first-execution (TTFX) for all major
operations.
## Performance Improvements
| Metric | Before | After | Improvement |
|--------|--------|-------|-------------|
| Startup time | 0.817s | 0.032s | 96% reduction |
| TTFX setindex! | 0.040s | 0.000034s | 99.9% reduction |
| TTFX getindex | 0.019s | 0.000016s | 99.9% reduction |
| TTFX setdiagonal! | 0.026s | 0.000009s | 99.97% reduction |
| TTFX mul! | 0.300s | 0.000158s | 99.95% reduction |
## Changes
- Add PrecompileTools.jl as a dependency
- Add @compile_workload block that precompiles:
- SparseBandedMatrix{Float64} constructor
- setindex! and getindex operations
- setdiagonal! for both upper and lower diagonals
- mul! for all four variants:
- SparseBandedMatrix * Matrix
- Matrix * SparseBandedMatrix
- SparseBandedMatrix * SparseBandedMatrix -> Matrix
- SparseBandedMatrix * SparseBandedMatrix -> SparseBandedMatrix
## Analysis
- Used SnoopCompile to profile inference and identify expensive operations
- No invalidations detected - package is well-behaved
- Precompilation workload uses small 10x10 matrices for minimal overhead
🤖 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
Add precompilation workloads using PrecompileTools.jl to dramatically reduce startup time and time-to-first-execution (TTFX) for all major operations.
Performance Improvements
Changes
@compile_workloadblock that precompiles:SparseBandedMatrix{Float64}constructorsetindex!andgetindexoperationssetdiagonal!for both upper and lower diagonalsmul!for all four variants:Analysis
Test plan
cc @ChrisRackauckas
🤖 Generated with Claude Code