Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ using Random

function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
normedtypes = (N0f8, N0f16) # precompiled Normed types
realtypes = (Float16, Float32, Float64, Int) # types for mixed Normed/Real operations
normedtypes = (N0f8,) # N0f8 is most common and accelerates others, too
realtypes = (Float16, Float32, Float64, Int) # types for mixed Normed/Real operations
for T in normedtypes
for f in (+, -, abs, eps) # unary operations
precompile(Tuple{typeof(f),T})
Expand All @@ -29,5 +29,12 @@ function _precompile_()
precompile(Tuple{typeof(convert),Type{T},S})
precompile(Tuple{typeof(convert),Type{S},T})
end
# display in the terminal, into pipes and into buffers (e.g. `repr`)
for IOT in (IOContext{Base.TTY}, IOContext{Base.PipeEndpoint}, IOContext{IOBuffer}, IOBuffer)
precompile(Tuple{typeof(show),IOT,T})
precompile(Tuple{typeof(print),IOT,T})
precompile(Tuple{typeof(show),IOT,MIME"text/plain",T})
precompile(Tuple{typeof(show),IOT,MIME"text/plain",Vector{T}})
end
end
end
Loading