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 and use PrecompileTools #26

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ KiteUtils = "90980105-b163-44e5-ba9f-8b1c83bb0533"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
Expand All @@ -26,6 +27,7 @@ Joysticks = "0.1.2, 0.1.4"
KiteUtils = "~0.5"
Parameters = "0.12"
Pkg = "1.9, 1.10"
PrecompileTools = "1.2"
Reexport = "1"
Rotations = "1.2, 1.3"
StaticArrays = "~1.9"
Expand Down
18 changes: 18 additions & 0 deletions src/KiteViewers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module KiteViewers

using PrecompileTools: @setup_workload, @compile_workload
using GeometryBasics, Rotations, GLMakie, FileIO, LinearAlgebra, Printf, Parameters, Reexport
import GeometryBasics:Point3f, GeometryBasics.Point2f
using KiteUtils
Expand All @@ -22,4 +23,21 @@
states::Vector{SysState{7}} = SysState{7}[]
end

@setup_workload begin
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
# precompile file and potentially make loading faster.
# list = [OtherType("hello"), OtherType("world!")]
set_data_path()
@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)
viewer=Viewer3D(true)
segments=6

Check warning on line 35 in src/KiteViewers.jl

View check run for this annotation

Codecov / codecov/patch

src/KiteViewers.jl#L35

Added line #L35 was not covered by tests
state=demo_state_4p(segments+1)
update_system(viewer, state, kite_scale=0.25)
close(viewer.screen)
nothing

Check warning on line 39 in src/KiteViewers.jl

View check run for this annotation

Codecov / codecov/patch

src/KiteViewers.jl#L39

Added line #L39 was not covered by tests
end
end

end
Loading