Skip to content

Commit 9eaee82

Browse files
authored
Merge pull request #52 from JuliaGraphics/teh/ttfp
Add a few precompiles
2 parents f8f29aa + 82a1121 commit 9eaee82

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/FreeTypeAbstraction.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ function __init__()
3535
append!(valid_fontpaths, paths)
3636
end
3737

38+
if Base.VERSION >= v"1.4.2"
39+
include("precompile.jl")
40+
_precompile_()
41+
end
42+
3843
end # module

src/precompile.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function _precompile_()
2+
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
3+
@assert precompile(Tuple{typeof(findfont),String}) # time: 0.12886831
4+
@assert precompile(Tuple{typeof(try_load),String}) # time: 0.033520337
5+
@assert precompile(Tuple{typeof(renderface),FTFont,Char,Int64}) # time: 0.019107351
6+
end

0 commit comments

Comments
 (0)