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

Add precompile step for rePCA #749

Merged
merged 10 commits into from
Sep 3, 2024
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ docs/src/assets/*.svg
test/scratch.jl
tune.json
Manifest.toml
Manifest-v*.toml
settings.json
docs/jmd
LocalPreferences.toml
benchmark.md

10 changes: 7 additions & 3 deletions src/MixedModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,19 @@ include("profile/profile.jl")
sleepstudy = MixedModels.dataset(:sleepstudy)
contra = MixedModels.dataset(:contra)
progress = false
io = IOBuffer()
@compile_workload begin
# all calls in this block will be precompiled, regardless of whether
# they belong to your package or not (on Julia 1.8 and higher)

# these are relatively small models and so shouldn't increase precompile times all that much
# while still massively boosting load and TTFX times
fit(MixedModel,
@formula(reaction ~ 1 + days + (1 + days | subj)),
sleepstudy; progress)
m = fit(MixedModel,
@formula(reaction ~ 1 + days + (1 + days | subj)),
sleepstudy; progress)
palday marked this conversation as resolved.
Show resolved Hide resolved
show(io, m)
show(io, m.PCA.subj)
show(io, m.rePCA)
fit(MixedModel,
@formula(use ~ 1 + age + abs2(age) + urban + livch + (1 | urban & dist)),
contra,
Expand Down
Loading