From b6d0878c9534f8f2ac2af72a403f5c76886457b4 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Thu, 14 Mar 2024 19:54:38 +0100 Subject: [PATCH 1/2] add and use PrecompileTools --- Project.toml | 2 ++ src/KiteViewers.jl | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Project.toml b/Project.toml index ca50c03..a7b1e37 100644 --- a/Project.toml +++ b/Project.toml @@ -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" @@ -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" diff --git a/src/KiteViewers.jl b/src/KiteViewers.jl index fd132fd..896e8ef 100644 --- a/src/KiteViewers.jl +++ b/src/KiteViewers.jl @@ -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 @@ -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 From 435de93e623afe36f6d48dfe0ee854954d143ff8 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Thu, 14 Mar 2024 20:11:53 +0100 Subject: [PATCH 2/2] Update CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c17ddc4..c4da267 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 }}