forked from JuliaPlots/Plots.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from daschw/precompile
add CompileBot
- Loading branch information
Showing
14 changed files
with
298 additions
and
15 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,88 @@ | ||
name: SnoopCompile | ||
|
||
on: | ||
push: | ||
branches: | ||
# - 'master' # NOTE: to run the bot only on pushes to master | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
SnoopCompile: | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
env: | ||
GKS_ENCODING: "utf8" | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: # NOTE: the versions below should match those in your botconfig | ||
- '1.5' | ||
os: # NOTE: should match the os setting of your botconfig | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
# Setup environment | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
julia --project -e 'using Pkg; Pkg.instantiate();' | ||
julia -e 'using Pkg; Pkg.add( PackageSpec(name = "CompileBot", version = "1") ); Pkg.develop(PackageSpec(; path=pwd())); using CompileBot; CompileBot.addtestdep();' | ||
# TESTCMD | ||
- name: Default TESTCMD | ||
run: echo ::set-env name=TESTCMD::"julia" | ||
- name: Ubuntu TESTCMD | ||
if: startsWith(matrix.os,'ubuntu') | ||
run: echo ::set-env name=TESTCMD::"xvfb-run --auto-servernum julia" | ||
|
||
# Generate precompile files | ||
- name: Generating precompile files | ||
run: $TESTCMD --project -e 'include("deps/SnoopCompile/snoop_bot.jl")' # NOTE: must match path | ||
|
||
# Run benchmarks | ||
- name: Running Benchmark | ||
run: $TESTCMD --project -e 'include("deps/SnoopCompile/snoop_bench.jl")' # NOTE: optional, if have benchmark file | ||
|
||
- name: Upload all | ||
uses: actions/[email protected] | ||
with: | ||
path: ./ | ||
|
||
Create_PR: | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
needs: SnoopCompile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download all | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: CompileBot postprocess | ||
run: julia -e 'using Pkg; Pkg.add( PackageSpec(name = "CompileBot", version = "1") ); using CompileBot; CompileBot.postprocess();' | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Update precompile_*.jl file | ||
title: "[AUTO] Update precompiles" | ||
labels: SnoopCompile | ||
branch: "SnoopCompile_AutoPR" | ||
|
||
|
||
Skip: | ||
if: "contains(github.event.head_commit.message, '[skip ci]')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Skip CI 🚫 | ||
run: echo skip ci |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "RecipesPipeline" | ||
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" | ||
authors = ["Michael Krabbe Borregaard <[email protected]>"] | ||
version = "0.1.13" | ||
version = "0.2" | ||
|
||
[deps] | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
|
94 changes: 94 additions & 0 deletions
94
RecipesPipeline/deps/SnoopCompile/precompile/linux/1.5/precompile_RecipesPipeline.jl
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,94 @@ | ||
const __bodyfunction__ = Dict{Method,Any}() | ||
|
||
# Find keyword "body functions" (the function that contains the body | ||
# as written by the developer, called after all missing keyword-arguments | ||
# have been assigned values), in a manner that doesn't depend on | ||
# gensymmed names. | ||
# `mnokw` is the method that gets called when you invoke it without | ||
# supplying any keywords. | ||
function __lookup_kwbody__(mnokw::Method) | ||
function getsym(arg) | ||
isa(arg, Symbol) && return arg | ||
@assert isa(arg, GlobalRef) | ||
return arg.name | ||
end | ||
|
||
f = get(__bodyfunction__, mnokw, nothing) | ||
if f === nothing | ||
fmod = mnokw.module | ||
# The lowered code for `mnokw` should look like | ||
# %1 = mkw(kwvalues..., #self#, args...) | ||
# return %1 | ||
# where `mkw` is the name of the "active" keyword body-function. | ||
ast = Base.uncompressed_ast(mnokw) | ||
if isa(ast, Core.CodeInfo) && length(ast.code) >= 2 | ||
callexpr = ast.code[end-1] | ||
if isa(callexpr, Expr) && callexpr.head == :call | ||
fsym = callexpr.args[1] | ||
if isa(fsym, Symbol) | ||
f = getfield(fmod, fsym) | ||
elseif isa(fsym, GlobalRef) | ||
if fsym.mod === Core && fsym.name === :_apply | ||
f = getfield(mnokw.module, getsym(callexpr.args[2])) | ||
elseif fsym.mod === Core && fsym.name === :_apply_iterate | ||
f = getfield(mnokw.module, getsym(callexpr.args[3])) | ||
else | ||
f = getfield(fsym.mod, fsym.name) | ||
end | ||
else | ||
f = missing | ||
end | ||
else | ||
f = missing | ||
end | ||
else | ||
f = missing | ||
end | ||
__bodyfunction__[mnokw] = f | ||
end | ||
return f | ||
end | ||
|
||
function _precompile_() | ||
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing | ||
Base.precompile(Tuple{typeof(Base.Broadcast.materialize),Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(RecipesPipeline._scaled_adapted_grid),Tuple{Array{Function,1},Base.RefValue{Symbol},Base.RefValue{Symbol},Float64,Float64}}}) | ||
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Array{Function,1},Number,Number}) | ||
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},RecipesPipeline.GroupBy,Any}) | ||
Base.precompile(Tuple{typeof(RecipesBase.apply_recipe),AbstractDict{Symbol,Any},Type{RecipesPipeline.SliceIt},Any,Any,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._apply_type_recipe),Any,AbstractArray,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._apply_type_recipe),Any,Surface,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._extract_group_attributes),Array{String,1},Array{Float64,1}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._map_funcs),Function,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._process_plotrecipes!),Any,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._process_ribbon),Tuple{LinRange{Float64},LinRange{Float64}},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._process_seriesrecipe),Any,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._process_seriesrecipes!),Any,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{AbstractArray{Float64,1},1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Array{Float64,1},1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Array{T,1} where T,1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Float64,2},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Function,1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Int64,1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Real,1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{String,1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Array{Union{Missing, Int64},1},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Int64,Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),StepRange{Int64,Int64},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Surface{Array{Int64,2}},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline._series_data_vector),Surface{Base.ReshapedArray{Int64,2,UnitRange{Int64},Tuple{}}},Dict{Symbol,Any}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline.recipe_pipeline!),Any,Any,Any}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline.typerecipe_signature_string),typeof(atan)}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline.unzip),Array{Tuple{Array{Float64,1},Array{Float64,1}},1}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline.unzip),Array{Tuple{Float64,Float64,Float64},1}}) | ||
Base.precompile(Tuple{typeof(RecipesPipeline.unzip),Array{Tuple{Int64,Real},1}}) | ||
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(string),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(typeof),Tuple{Tuple{Base.OneTo{Int64},Base.OneTo{Int64},Surface{Array{Int64,2}}}}}}}}) | ||
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(string),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(typeof),Tuple{Tuple{RecipesPipeline.GroupBy,Array{Float64,1}}}}}}}) | ||
Base.precompile(Tuple{typeof(copy),Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(string),Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.Style{Tuple},Nothing,typeof(typeof),Tuple{Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Surface{Array{Float64,2}}}}}}}}) | ||
Base.precompile(Tuple{typeof(setindex!),RecipesPipeline.DefaultsDict,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},Symbol}) | ||
let fbody = try __lookup_kwbody__(which(RecipesPipeline._extract_group_attributes, (Array{String,1},Array{Float64,1},))) catch missing end | ||
if !ismissing(fbody) | ||
precompile(fbody, (Function,typeof(RecipesPipeline._extract_group_attributes),Array{String,1},Array{Float64,1},)) | ||
end | ||
end | ||
end |
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,10 @@ | ||
using CompileBot | ||
|
||
snoop_bench( | ||
BotConfig( | ||
"RecipesPipeline", | ||
yml_path= "SnoopCompile.yml", | ||
else_os = "linux", | ||
else_version = "1.5", | ||
) | ||
) |
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,10 @@ | ||
using CompileBot | ||
|
||
snoop_bot( | ||
BotConfig( | ||
"RecipesPipeline", | ||
yml_path= "SnoopCompile.yml", | ||
else_os = "linux", | ||
else_version = "1.5", | ||
) | ||
) |
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
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
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
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,34 @@ | ||
should_precompile = true | ||
|
||
|
||
# Don't edit the following! Instead change the script for `snoop_bot`. | ||
ismultios = true | ||
ismultiversion = true | ||
# precompile_enclosure | ||
@static if !should_precompile | ||
# nothing | ||
elseif !ismultios && !ismultiversion | ||
include("../deps/SnoopCompile/precompile/precompile_RecipesPipeline.jl") | ||
_precompile_() | ||
else | ||
@static if Sys.islinux() | ||
@static if v"1.5.0-DEV" <= VERSION <= v"1.5.9" | ||
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_RecipesPipeline.jl") | ||
_precompile_() | ||
else | ||
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_RecipesPipeline.jl") | ||
_precompile_() | ||
end | ||
|
||
else | ||
@static if v"1.5.0-DEV" <= VERSION <= v"1.5.9" | ||
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_RecipesPipeline.jl") | ||
_precompile_() | ||
else | ||
include("../deps/SnoopCompile/precompile/linux/1.5/precompile_RecipesPipeline.jl") | ||
_precompile_() | ||
end | ||
|
||
end | ||
|
||
end # precompile_enclosure |
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
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
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.