Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate @unpack to reduce specializations (but keep v1.6 compat) #1893

Merged
merged 3 commits into from
Mar 4, 2023

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

@ChrisRackauckas ChrisRackauckas mentioned this pull request Mar 4, 2023
@ranocha
Copy link
Member

ranocha commented Mar 4, 2023

Did you measure the impact on precompile/load times? This would be quite interesting for a lot of my packages, too.

@ChrisRackauckas
Copy link
Member Author

image

It's at least a piece of the puzzle

I'll figure out where we're at after #1892 + SciML/SciMLOperators.jl#155

@ChrisRackauckas
Copy link
Member Author

#1892 had a bigger effect so far, but we're almost <100mb now when it's all together.

@ranocha
Copy link
Member

ranocha commented Mar 4, 2023

Cool - I'm looking forward to it!

@@ -3,7 +3,11 @@
# III.5 Variable Step Size Multistep Methods: Formulae 5.9
function ϕ_and_ϕstar!(cache, du, k)
@inbounds begin
@unpack dts, ϕstar_nm1, ϕ_n, ϕstar_n, β = cache
@static if VERSION >= v"1.8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this could be made into a custom @unpack macro to avoid the code duplications? Or even just changed in UnPack.jl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpack.jl handles cases other than types, while this does not. And this will be easy to delete once LTS changes.

@devmotion
Copy link
Member

I played around a bit and came up with a more lightweight @unpack macro: https://github.com/devmotion/SimpleUnPack.jl On Julia >= 1.7.0-DEV.364 it uses the destructuring syntax and also on older Julia versions it is solely based on getproperty. Thus it's less flexible than UnPack but should also fix compilation times and the large amount of method definitions on older Julia versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants