JuliaLang / JuliaLang/PrecompileTools.jl
Disable all precompilation workloads except my own
- Dominant language
- Julia
- Stars
- 249
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
Basically I have written a precompile workload that covered everything i want to precompile.
As such I do not want any of the packages I am depending on to run their precompile workloads,
because they will also include things i do not want.
I asked in [slack](https://julialang.slack.com/archives/C67910KEH/p1769144096854659) a longer version of this:
> So I have a local Julia package that is called only from a python package that it shares a mono-repo with.
> Now that Julia package depends on a huge number of Julia packages mostly cos it depends on Catalyst.jl.
> But the portion of their APIs it uses when called from python is actually tiny.
>
> So I have written a PreCompileTools.jl workload that more or less fully exercises that API.
> Can I set things up some how to never run the preconpulation stuff for any of my dependencies, and only run the stuff for my package itself.
> And still have it cache the stuff for both my package and it's dependencies that actually gets hit by my preconpilation workload?
> I think it's going to net out a lot faster for me, especially in CI,
> As the dependencies own precipitation stuff clearly doesn't do much for me since my first call of everything takes so much longer than my second.
Checking the logic in the code:
https://github.com/JuliaLang/PrecompileTools.jl/blob/542d9648d44984bc92491399a5b911eb8def5086/src/workloads.jl#L5-L9
It seems that if `PrecompileTools`'s preference is set to false, then it is universally disabled.
So basically its `ALL & PKG`
I propose more complex logic,
where if the package doesn't have any setting set, it uses the overall setting.
But if it does then that overrides it.
So basically:
| ALL | PKG | enable in package? |
|-------|---------|--------------------|
| FALSE | nothing | FALSE |
| TRUE | nothing | TRUE |
| FALSE | FALSE | FALSE |
| TRUE | TRUE | TRUE |
| FALSE | TRUE | TRUE |
| TRUE | FALSE | FALSE |
So the code would be:
```julia
mod_pref = load_preference(mod, "precompile_workload", nothing)
if !isnothing(mod_pref):
return mod_pref
else:
return load_preference(@__MODULE__, "precompile_workloads", true)
end
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/workloads.jl, especially the preference logic linked in the issue, and trace how package-specific and global settings are loaded. Done means the six combinations in the issue's table produce the stated enablement behavior, while preserving caching for workloads reached by the selected precompilation workload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100