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

Simplify precompiles #514

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Simplify precompiles #514

merged 2 commits into from
Feb 7, 2022

Conversation

timholy
Copy link
Member

@timholy timholy commented Feb 3, 2022

This switches to "do a little work" for precompilation,
rather than explicitly spelling out the specific signatures.
This should be more maintainable and potentially more
exhaustive (or could be made to be so) since it
precompiles across runtime dispatch boundaries.

There are also a couple of improvements in step_expr!
inference that I made while trying to track down some
invalidations. These weren't the cause, but they don't
hurt.

This switches to "do a little work" for precompilation,
rather than explicitly spelling out the specific signatures.
This should be more maintainable and potentially more
exhaustive (or could be made to be so) since it
precompiles across runtime dispatch boundaries.

There are also a couple of improvements in `step_expr!`
inference that I made while trying to track down some
invalidations. These weren't the cause, but they don't
hurt.
@codecov
Copy link

codecov bot commented Feb 3, 2022

Codecov Report

Merging #514 (479a236) into master (ad9bf37) will increase coverage by 2.95%.
The diff coverage is 23.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
+ Coverage   83.75%   86.70%   +2.95%     
==========================================
  Files          12       12              
  Lines        2320     2376      +56     
==========================================
+ Hits         1943     2060     +117     
+ Misses        377      316      -61     
Impacted Files Coverage Δ
src/precompile.jl 0.00% <0.00%> (ø)
src/interpret.jl 81.06% <100.00%> (+3.04%) ⬆️
src/commands.jl 93.07% <0.00%> (+0.27%) ⬆️
src/builtins.jl 68.87% <0.00%> (+0.64%) ⬆️
src/breakpoints.jl 95.55% <0.00%> (+0.81%) ⬆️
src/packagedef.jl 86.95% <0.00%> (+0.91%) ⬆️
src/utils.jl 85.95% <0.00%> (+1.00%) ⬆️
src/optimize.jl 97.83% <0.00%> (+1.10%) ⬆️
src/construct.jl 91.42% <0.00%> (+2.14%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad9bf37...479a236. Read the comment docs.

@timholy
Copy link
Member Author

timholy commented Feb 4, 2022

The main thing to think about here is whether we're OK with __JIInternal__ or whether a junk module is too high a price for the simplification here.

@KristofferC
Copy link
Member

The main thing to think about here is whether we're OK with JIInternal or whether a junk module is too high a price for the simplification here.

Doesn't feel that costly but is it not possible to use an "anonymous module" á la:

let
m = Module()
...

?

@timholy
Copy link
Member Author

timholy commented Feb 4, 2022

That's the first thing I tried. Here's what happens:

julia> using Anon
[ Info: Precompiling Anon [412b51d8-6eb2-47c2-9dc2-53277b3423fe]
ERROR: LoadError: Evaluation into the closed module `anonymous` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `anonymous` with `eval` during precompilation - don't do this.

@pfitzseb
Copy link
Member

pfitzseb commented Feb 7, 2022

Could also hide it better with module var"#Internal end.

@timholy
Copy link
Member Author

timholy commented Feb 7, 2022

I like that suggestion. I've updated this. It doesn't sound like there are any major concerns, so I'll merge. No need to tag immediately, so there's time to revisit this if someone objects.

@timholy timholy merged commit d172be1 into master Feb 7, 2022
@timholy timholy deleted the teh/pc branch February 7, 2022 17:02
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