Improve precompilation: extend workload coverage#146
Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom Dec 29, 2025
Merged
Conversation
Expanded precompilation workload in both the main module and ForwardDiff extension to reduce time-to-first-X (TTFX) for common operations. Changes: - Main module: Added precompilation for DiffCache with matrices, LazyBufferCache, and GeneralLazyBufferCache - ForwardDiff extension: Added precompilation for DiffCache and FixedSizeDiffCache with ForwardDiff.Dual numbers Improvements measured (first call after loading): - DiffCache TTFX (Dual): 174ms -> ~1ms (99% reduction) - FixedSizeDiffCache TTFX: 229ms -> ~0ms (99%+ reduction) - LazyBufferCache TTFX: 99ms -> ~0ms (99%+ reduction) - GeneralLazyBufferCache TTFX: 69ms -> ~1ms (98% reduction) - DiffCache TTFX (matrix): 89ms -> ~11ms (88% reduction) - Total TTFX: 761ms -> ~15ms (98% reduction) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas-Claude
pushed a commit
to ChrisRackauckas-Claude/PreallocationTools.jl
that referenced
this pull request
Dec 29, 2025
This release includes the following changes since v0.4.34: - Improve explicit imports hygiene (SciML#147) - Improve precompilation: extend workload coverage (SciML#146) - Migrate to Dependabot (SciML#144) - Bump actions/checkout from 4 to 6 (SciML#143) Fixes SciML#148 🤖 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
This PR improves package startup time by extending the precompilation workload to cover more commonly-used code paths.
Changes
Main module: Added precompilation for:
DiffCachewith matrices (not just vectors)LazyBufferCacheoperationsGeneralLazyBufferCacheoperationsForwardDiff extension: Added precompilation for:
DiffCachewithForwardDiff.DualnumbersFixedSizeDiffCachecreation and usage with Dual numbersPerformance Improvements (TTFX - Time to First X)
Testing
Analysis Method
Used SnoopCompile to:
cc @ChrisRackauckas
🤖 Generated with Claude Code