diff --git a/Project.toml b/Project.toml index ae4506c..3698b55 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" @@ -25,6 +26,7 @@ LinearAlgebra = "1" MAT = "0.10" MutableNamedTuples = "0.1.3" Plots = "1" +PrecompileTools = "1" Random = "1" StatsBase = "0.34" StatsPlots = "0.15" diff --git a/src/BeforeIT.jl b/src/BeforeIT.jl index b973393..51a0998 100644 --- a/src/BeforeIT.jl +++ b/src/BeforeIT.jl @@ -59,4 +59,7 @@ include("utils/standard_calibration_data.jl") # shocks include("shocks/shocks.jl") + +include("precompile.jl") + end diff --git a/src/precompile.jl b/src/precompile.jl new file mode 100644 index 0000000..f8ec69c --- /dev/null +++ b/src/precompile.jl @@ -0,0 +1,14 @@ + +using PrecompileTools + +@setup_workload let + parameters = BeforeIT.AUSTRIA2010Q1.parameters + initial_conditions = BeforeIT.AUSTRIA2010Q1.initial_conditions + T = 1 + @compile_workload let + model = BeforeIT.init_model(parameters, initial_conditions, T) + data = BeforeIT.init_data(model); + BeforeIT.one_epoch!(model) + BeforeIT.update_data!(data, model) + end +end \ No newline at end of file