Skip to content

Commit

Permalink
capture precompilation statements with SnoopPrecompile
Browse files Browse the repository at this point in the history
This is a simple test of the native code-caching functionality
in Julia 1.9. This should greatly improve runtime, at the
expense of greater precompilation time and slightly
greater package load time:

With this PR, the runtime on Julia 1.9:

```
julia> @time using FUSE
 21.957530 seconds (53.10 M allocations: 3.644 GiB, 8.49% gc time, 7.02% compilation time: 13% of which was recompilation)

julia> @time FUSE.warmup()
 43.951729 seconds (501.41 M allocations: 29.219 GiB, 8.02% gc time, 6.47% compilation time)
```

Whereas master:

```
julia> @time using FUSE
 15.015840 seconds (42.16 M allocations: 2.971 GiB, 8.52% gc time, 10.46% compilation time: 13% of which was recompilation)

julia> @time FUSE.warmup()
 373.581675 seconds (796.96 M allocations: 46.873 GiB, 5.31% gc time, 87.77% compilation time: <1% of which was recompilation)
```

xref: #252
xref: #218
  • Loading branch information
sjkelly committed Mar 15, 2023
1 parent 4398e29 commit 9773696
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ QED = "8bcbec86-48c7-11ec-16a6-c1bc83299373"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimulationParameters = "32ab26d3-25d6-405d-a295-367385e16093"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
TAUENN = "4f5ffc88-c87f-11eb-142e-4d2ba0394a67"
TEQUILA = "a60c9cbd-e72f-4185-96b6-b8fc312c4d37"
Expand Down
6 changes: 6 additions & 0 deletions src/FUSE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using IMAS
import Plots
using Plots
using Printf
using SnoopPrecompile

#= ===== =#
# UTILS #
Expand Down Expand Up @@ -116,6 +117,11 @@ include("logging.jl")
#= ===== =#
include("utils_end.jl")

#= ========== =#
# PRECOMPILE #
#= ========== =#
include("precompile.jl")

#= ====== =#
#= EXPORT =#
#= ====== =#
Expand Down
5 changes: 5 additions & 0 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@precompile_setup begin
@precompile_all_calls begin
FUSE.warmup()
end
end

0 comments on commit 9773696

Please sign in to comment.