Skip to content

Commit 060f4b5

Browse files
committed
Add a few precompiles
This package can't do a lot generically, but this is a bit useful.
1 parent 9e469a8 commit 060f4b5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/OffsetArrays.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,4 +509,9 @@ end
509509
import Adapt
510510
Adapt.adapt_structure(to, x::OffsetArray) = OffsetArray(Adapt.adapt(to, parent(x)), x.offsets)
511511

512+
if Base.VERSION >= v"1.4.2"
513+
include("precompile.jl")
514+
_precompile_()
515+
end
516+
512517
end # module

src/precompile.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function _precompile_()
2+
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
3+
Base.precompile(Tuple{typeof(Base.showarg),IOBuffer,OffsetArray{Int, 0, Array{Int, 0}},Bool}) # time: 0.037824474
4+
Base.precompile(Tuple{Type{IdOffsetRange{Int, Base.OneTo{Int}}},UnitRange{Int}}) # time: 0.009825722
5+
Base.precompile(Tuple{typeof(Base.inds2string),Tuple{IdOffsetRange{Int, Base.OneTo{Int}}, IdOffsetRange{Int, Base.OneTo{Int}}}}) # time: 0.0080779
6+
Base.precompile(Tuple{typeof(getindex),StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}},IdentityUnitRange{UnitRange{Int}}}) # time: 0.008055889
7+
Base.precompile(Tuple{typeof(getindex),StepRangeLen{Int, Int, Int},IdentityUnitRange{UnitRange{Int}}}) # time: 0.006584347
8+
Base.precompile(Tuple{typeof(getindex),StepRange{Int, Int},IdentityUnitRange{UnitRange{Int}}}) # time: 0.00650066
9+
Base.precompile(Tuple{typeof(getindex),LinRange{Float64},IdentityUnitRange{UnitRange{Int}}}) # time: 0.005844317
10+
Base.precompile(Tuple{typeof(zeros),Tuple{IdOffsetRange{Int, Base.OneTo{Int}}}}) # time: 0.007713056
11+
Base.precompile(Tuple{typeof(ones),Tuple{IdOffsetRange{Int, Base.OneTo{Int}}}}) # time: 0.007713056
12+
Base.precompile(Tuple{typeof(trues),Tuple{UnitRange{Int}, UnitRange{Int}}}) # time: 0.005478372
13+
Base.precompile(Tuple{typeof(falses),Tuple{UnitRange{Int}, UnitRange{Int}}}) # time: 0.005478372
14+
Base.precompile(Tuple{typeof(firstindex),IdOffsetRange{Int, Base.OneTo{Int}}}) # time: 0.004100289
15+
end

0 commit comments

Comments
 (0)