Skip to content

Commit

Permalink
Merge pull request #39 from ufechner7/precompile
Browse files Browse the repository at this point in the history
Precompile using PrecompileTools
  • Loading branch information
ufechner7 authored Mar 9, 2024
2 parents 274c97e + 38ef4ae commit 9a41771
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -22,10 +23,11 @@ Arrow = "2.7.1"
CSV = "0.10.13"
DocStringExtensions = "0.9.3"
Parameters = "0.12.3"
PrecompileTools = "1.2.1"
RecursiveArrayTools = "3.3.3"
Rotations = "1.7.0"
StaticArrays = "1.9.3"
StructArrays = "0.6.18"
Rotations = "1.7.0"
StructTypes = "1.10.0"
YAML = "0.4.9"
julia = "1.9, 1.10"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you want to run simulations and see the results in 3D, please install the met
If you just want to learn how this package works quickly just install only this package.

## Installation
Download [Julia 1.6](http://www.julialang.org) or later, if you haven't already. You can add KiteUtils from Julia's package manager, by typing
Download [Julia 1.9](http://www.julialang.org) or later, if you haven't already. You can add KiteUtils from Julia's package manager, by typing
```julia
using Pkg
pkg"add KiteUtils"
Expand Down
Binary file modified data/Test_flight.arrow
Binary file not shown.
14 changes: 12 additions & 2 deletions src/KiteUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SOFTWARE. =#
# the parameter P is the number of points of the tether, equal to segments+1
# in addition helper functions for working with rotations

using PrecompileTools: @setup_workload, @compile_workload
using Rotations, StaticArrays, StructArrays, RecursiveArrayTools, Arrow, YAML, LinearAlgebra, DocStringExtensions
using Parameters, StructTypes
export Settings, SysState, SysLog, Logger, MyFloat
Expand Down Expand Up @@ -396,7 +397,16 @@ function test(save=false)
return(load_log(7, "Test_flight.arrow"))
end

precompile(load_log, (Int64, String,))
precompile(se, ())
@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!")]
@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)
se()
load_log(7, "Test_flight.arrow")
end
end

end

0 comments on commit 9a41771

Please sign in to comment.