-
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
precompile functions to reduce compilation time of first plot
- Loading branch information
Showing
4 changed files
with
891 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# To figure out what should be precompiled, run this script, then move | ||
# precompile_Plots.jl in precompiles_path (see below) to src/precompile.jl | ||
|
||
using SnoopCompile | ||
|
||
log_path = joinpath(tempdir(), "compiles.log") | ||
precompiles_path = joinpath(tempdir(), "precompile") | ||
|
||
# run examples with GR backend, logging what needs to be compiled | ||
SnoopCompile.@snoopc log_path begin | ||
using Plots | ||
Plots.test_examples(:gr, disp=true) | ||
end | ||
|
||
# precompile calls containing the following strings are dropped | ||
blacklist = [ | ||
# functions defined in examples | ||
"PlotExampleModule", | ||
# the following are not visible to Plots, only its dependencies | ||
"CategoricalArrays", | ||
"FixedPointNumbers", | ||
"SparseArrays" | ||
] | ||
|
||
data = SnoopCompile.read(log_path) | ||
pc = SnoopCompile.parcel(reverse!(data[2]), blacklist=blacklist) | ||
SnoopCompile.write(precompiles_path, pc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,4 +222,7 @@ end | |
|
||
const CURRENT_BACKEND = CurrentBackend(:none) | ||
|
||
include("precompile.jl") | ||
_precompile_() | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.