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

Base.Precompilation.ExplicitEnv: handle type instability better in constructor #57599

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented Mar 1, 2025

Avoiding the converting setindex! should hopefully diminish unwarranted invalidation of user code.

Avoiding the converting `setindex!` should hopefully diminish
unwarranted invalidation of user code.
@nsajko nsajko added compiler:precompilation Precompilation of modules invalidations labels Mar 1, 2025
@nsajko nsajko changed the title Base.Precompilation.ExplicitEnv: handle type instability better Base.Precompilation.ExplicitEnv: handle type instability better in constructor Mar 1, 2025
@nsajko
Copy link
Contributor Author

nsajko commented Mar 1, 2025

Decreases the invalidation count on running the following code from 2061 to 1996 🚀

struct I <: Integer end
Base.Int(::I) = 7

@nsajko nsajko added the merge me PR is reviewed. Merge when all tests are passing label Mar 1, 2025
@IanButterworth IanButterworth merged commit 1e03ed6 into JuliaLang:master Mar 2, 2025
9 of 11 checks passed
@IanButterworth IanButterworth added backport 1.11 Change should be backported to release-1.11 backport 1.12 Change should be backported to release-1.12 labels Mar 2, 2025
@nsajko nsajko deleted the Base_precompilation_ExplicitEnv_type_stability branch March 2, 2025 04:19
@nsajko nsajko removed the merge me PR is reviewed. Merge when all tests are passing label Mar 2, 2025
KristofferC pushed a commit that referenced this pull request Mar 3, 2025
…constructor (#57599)

Avoiding the converting `setindex!` should hopefully diminish
unwarranted invalidation of user code.

(cherry picked from commit 1e03ed6)
@KristofferC KristofferC mentioned this pull request Mar 3, 2025
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 backport 1.12 Change should be backported to release-1.12 compiler:precompilation Precompilation of modules invalidations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants