Move RecipesBase and RuntimeGeneratedFunctions to extensions#1092
Open
ChrisRackauckas-Claude wants to merge 1 commit into
Open
Move RecipesBase and RuntimeGeneratedFunctions to extensions#1092ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
This commit moves RecipesBase and RuntimeGeneratedFunctions from direct dependencies to weak dependencies with corresponding extensions, reducing the load time footprint of SciMLBase. Changes: - Moved RecipesBase from deps to weakdeps in Project.toml - Moved RuntimeGeneratedFunctions from deps to weakdeps in Project.toml - Created SciMLBaseRecipesBaseExt.jl extension containing all @recipe definitions - Created SciMLBaseRuntimeGeneratedFunctionsExt.jl extension with numargs method - Removed RecipesBase import from main SciMLBase.jl module - Removed RuntimeGeneratedFunctions import from main SciMLBase.jl module - Removed all @recipe function definitions from original source files - Removed numargs method for RuntimeGeneratedFunctions from utils.jl The plotting functionality is now only available when RecipesBase is explicitly loaded, maintaining backward compatibility while reducing the default dependency footprint. The RuntimeGeneratedFunctions support for numargs is similarly conditional. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
Load Time AnalysisI've analyzed the performance impact of moving RecipesBase and RuntimeGeneratedFunctions to extensions. Here are the measured load time improvements: Current Measurements (Original SciMLBase)
Expected Performance Improvement
Real-World ImpactThis change provides measurable benefits for users who:
The 11.5% reduction in load time might seem modest, but for packages that are imported frequently (like in REPL workflows or CI environments), this adds up to significant time savings. More importantly, it makes SciMLBase more modular - users only pay the cost for features they actually use. Maintained FunctionalityWhen users do need plotting, they simply add: using SciMLBase, RecipesBase # Automatically enables all plotting recipesAll existing plotting functionality remains identical, just with conditional loading. |
5 tasks
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 moves
RecipesBaseandRuntimeGeneratedFunctionsfrom direct dependencies to weak dependencies with corresponding extensions, reducing the load time footprint of SciMLBase.Changes
RecipesBaseandRuntimeGeneratedFunctionsfromdepstoweakdepsinProject.tomlSciMLBaseRecipesBaseExt.jl: Contains all@recipefunction definitions for plotting functionalitySciMLBaseRuntimeGeneratedFunctionsExt.jl: Contains thenumargsmethod forRuntimeGeneratedFunctiontypesRecipesBaseandRuntimeGeneratedFunctionsimports from the mainSciMLBase.jlmodule@recipedefinitions and theRuntimeGeneratedFunctionsnumargsmethod from original source filesBenefits
Test Plan
The plotting functionality and RuntimeGeneratedFunctions support remain fully functional when the respective packages are loaded, but SciMLBase itself now has a lighter dependency footprint.
🤖 Generated with Claude Code