Add precompilation workload to improve TTFX#50
Merged
ChrisRackauckas merged 2 commits intoSciML:mainfrom Jan 11, 2026
Merged
Conversation
This adds a PrecompileTools workload that precompiles the most common code paths for operator splitting problems using LieTrotterGodunov with Euler integrators. Performance improvements: - TTFX init: 4.05s -> 2.51s (~38% reduction) - TTFX solve: 1.81s -> 1.44s (~20% reduction) - TTFX total: 5.86s -> 3.94s (~33% reduction) Changes: - Added PrecompileTools and OrdinaryDiffEqLowOrderRK as dependencies - Created src/precompilation.jl with a minimal workload that exercises GenericSplitFunction, OperatorSplittingProblem, and LieTrotterGodunov with Euler integrators The package load time increases slightly (~1.22s -> 1.27s) due to loading the precompiled code, but this is more than offset by the significant TTFX improvements. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
85d05a7 to
1d1b2b8
Compare
- Use explicit import `using PrecompileTools: @compile_workload` instead of implicit `using PrecompileTools` to pass ExplicitImports check - Add explicit `return` statements to satisfy Runic formatting 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
This PR adds a PrecompileTools workload that precompiles the most common code paths for operator splitting problems.
Performance improvements:
Changes
PrecompileToolsandOrdinaryDiffEqLowOrderRKas dependenciessrc/precompilation.jlwith a minimal workload that exercises:GenericSplitFunctioncreationOperatorSplittingProblemconstructionLieTrotterGodunovwithEulerintegratorsinit,step!, andsolve!operationsInvalidation Analysis
Checked for invalidations using SnoopCompile. Found 76 invalidation trees with 3,741 total invalidated method instances, but these are from upstream dependencies (Static.jl, RecursiveArrayTools, SciMLBase, FillArrays, CommonWorldInvalidations) and not from this package.
Test plan
Pkg.test()to verify all tests pass🤖 Generated with Claude Code
cc @ChrisRackauckas