Skip to content

Commit aa81bf6

Browse files
authored
Merge pull request #26 from aenarete/precompile
Add and use PrecompileTools
2 parents 6138097 + 435de93 commit aa81bf6

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
arch:
2626
- x64
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
2929
- uses: julia-actions/setup-julia@v1
3030
with:
3131
version: ${{ matrix.version }}

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ KiteUtils = "90980105-b163-44e5-ba9f-8b1c83bb0533"
1212
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1313
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1414
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
15+
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1516
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1617
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1718
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
@@ -26,6 +27,7 @@ Joysticks = "0.1.2, 0.1.4"
2627
KiteUtils = "~0.5"
2728
Parameters = "0.12"
2829
Pkg = "1.9, 1.10"
30+
PrecompileTools = "1.2"
2931
Reexport = "1"
3032
Rotations = "1.2, 1.3"
3133
StaticArrays = "~1.9"

src/KiteViewers.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module KiteViewers
22

3+
using PrecompileTools: @setup_workload, @compile_workload
34
using GeometryBasics, Rotations, GLMakie, FileIO, LinearAlgebra, Printf, Parameters, Reexport
45
import GeometryBasics:Point3f, GeometryBasics.Point2f
56
using KiteUtils
@@ -22,4 +23,21 @@ include("common.jl")
2223
states::Vector{SysState{7}} = SysState{7}[]
2324
end
2425

26+
@setup_workload begin
27+
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
28+
# precompile file and potentially make loading faster.
29+
# list = [OtherType("hello"), OtherType("world!")]
30+
set_data_path()
31+
@compile_workload begin
32+
# all calls in this block will be precompiled, regardless of whether
33+
# they belong to your package or not (on Julia 1.8 and higher)
34+
viewer=Viewer3D(true)
35+
segments=6
36+
state=demo_state_4p(segments+1)
37+
update_system(viewer, state, kite_scale=0.25)
38+
close(viewer.screen)
39+
nothing
40+
end
41+
end
42+
2543
end

0 commit comments

Comments
 (0)