Skip to content

Commit

Permalink
Merge pull request #26 from aenarete/precompile
Browse files Browse the repository at this point in the history
Add and use PrecompileTools
  • Loading branch information
ufechner7 authored Mar 14, 2024
2 parents 6138097 + 435de93 commit aa81bf6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
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 @@ include("common.jl")
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
state=demo_state_4p(segments+1)
update_system(viewer, state, kite_scale=0.25)
close(viewer.screen)
nothing
end
end

end

0 comments on commit aa81bf6

Please sign in to comment.