Skip to content

Commit

Permalink
add precompilation to greatly reduce time taken by first operation
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 18, 2023
1 parent 675f453 commit 09e6286
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
Expand Down
5 changes: 5 additions & 0 deletions src/SimulationService.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module SimulationService

import PrecompileTools: @recompile_invalidations

@recompile_invalidations begin
import AMQPClient
import CSV
import DataFrames: DataFrame, names, rename!
Expand All @@ -26,6 +29,7 @@ import SymbolicUtils
import UUIDs
import YAML
import Statistics
end

export start!, stop!

Expand Down Expand Up @@ -415,5 +419,6 @@ end
#-----------------------------------------------------------------------------# operations.jl
include("operations.jl")

include("precompile.jl")

end # module
3 changes: 3 additions & 0 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@compile_workload begin
SimulationService.amr_get(JSON3.read(joinpath(@__DIR__, "..", "examples", "calibrate_example1", "BIOMD0000000955_askenet.json")), ODESystem)
end

0 comments on commit 09e6286

Please sign in to comment.