From 8fd087325c7a617236e053b71ac2b5ffb5dbab29 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 24 Feb 2021 15:05:09 -0500 Subject: [PATCH 1/6] setup SnoopCompile tools and precomp directives --- .gitignore | 2 +- dev/precomp_gen.jl | 14 ++++++ dev/snooping.jl | 54 +++++++++++++++++++++ src/TiffImages.jl | 5 ++ src/precompile.jl | 114 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 dev/precomp_gen.jl create mode 100644 dev/snooping.jl create mode 100644 src/precompile.jl diff --git a/.gitignore b/.gitignore index 2f4d3ce5..3687fa47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .DS_Store Manifest.toml -/dev/ +/dev/precomp_files/ docs/build/ docs/src/examples/ diff --git a/dev/precomp_gen.jl b/dev/precomp_gen.jl new file mode 100644 index 00000000..5d3d5857 --- /dev/null +++ b/dev/precomp_gen.jl @@ -0,0 +1,14 @@ +using TiffImages +using TiffImages.ColorTypes: Gray, RGB +using TiffImages.FixedPointNumbers: N0f8 + +fpath = "test.tiff" +for t in [N0f8, Float64] + for typ in [Gray, RGB] + img = rand(typ{t}, 2, 2) + TiffImages.save(fpath, img) + img2 = TiffImages.load(fpath) + end +end + +include(joinpath(dirname(@__DIR__), "test", "runtests.jl")) diff --git a/dev/snooping.jl b/dev/snooping.jl new file mode 100644 index 00000000..36e89357 --- /dev/null +++ b/dev/snooping.jl @@ -0,0 +1,54 @@ +using SnoopCompile +import Pkg + +Pkg.activate(joinpath(dirname(@__DIR__), "test")) +Pkg.instantiate() +Pkg.precompile() + +@warn "Remember to comment out the precompile block at the end of the module first" + +tinf = @snoopi_deep include(joinpath(@__DIR__, "precomp_gen.jl")) + +ttot, pcs = SnoopCompile.parcel(tinf) + +pre_dir = joinpath(dirname(@__DIR__), "src") +temp_pre_dir = joinpath(@__DIR__, "precomp_files") + +SnoopCompile.write(temp_pre_dir, pcs) + +cp(joinpath(temp_pre_dir, "precompile_TiffImages.jl"), joinpath(pre_dir, "precompile.jl"), force=true) + +# Version 1.7.0-DEV.599 (2021-02-23) results + +# Test: no precompile statements out of 8.5968e-5 +# Base.Multimedia: no precompile statements out of 0.000275989 +# Base.SimdLoop: no precompile statements out of 0.000407908 +# Base.Order: no precompile statements out of 0.000536852 +# FileIO: no precompile statements out of 0.000550962 +# Markdown: no precompile statements out of 0.0006239080000000001 +# FixedPointNumbers: no precompile statements out of 0.001040202 +# ColorVectorSpace: no precompile statements out of 0.001379413 +# Logging: precompiled 0.001722304 out of 0.001722304 +# OffsetArrays: no precompile statements out of 0.002296208 +# Core: no precompile statements out of 0.0034895629999999998 +# LinearAlgebra: precompiled 0.0013803869999999998 out of 0.004956093999999999 +# InteractiveUtils: precompiled 0.00626247 out of 0.00626247 +# Base.Threads: precompiled 0.009569629 out of 0.009569629 +# SparseArrays: precompiled 0.012367197999999998 out of 0.012367197999999998 +# Base.Iterators: precompiled 0.012117240999999999 out of 0.012684179 +# ProgressMeter: precompiled 0.013705748 out of 0.013705748 +# Downloads: precompiled 0.014950076 out of 0.014950076 +# Base.Sort: precompiled 0.016226450999999996 out of 0.016226450999999996 +# Random: precompiled 0.017393442 out of 0.017393442 +# ColorTypes: precompiled 0.020498265 out of 0.023748921 +# Base.IteratorsMD: precompiled 0.035884334000000004 out of 0.03903587000000001 +# Documenter.DocMeta: precompiled 0.051472402 out of 0.051472402 +# Documenter.Utilities.Markdown2: precompiled 0.05216909700000002 out of 0.055926490000000016 +# ChainRulesCore: precompiled 0.06667838000000001 out of 0.06667838 +# Base.Broadcast: precompiled 0.124451302 out of 0.13479977599999995 +# DocStringExtensions: precompiled 0.2535032259999999 out of 0.25378781899999997 +# Documenter.DocTests: precompiled 0.3671079589999999 out of 0.36790237199999987 +# Documenter: precompiled 0.552544844 out of 0.552544844 +# Base: precompiled 0.5551221220000002 out of 0.6030158669999999 +# Documenter.Builder: precompiled 2.3401716290000003 out of 2.3410122970000007 +# TiffImages: precompiled 3.5842173639999997 out of 3.6049806520000005 diff --git a/src/TiffImages.jl b/src/TiffImages.jl index 7d7f4c90..36bd9961 100644 --- a/src/TiffImages.jl +++ b/src/TiffImages.jl @@ -31,4 +31,9 @@ include("load.jl") @deprecate TiffFile(::Type{O}) where O<:Unsigned TiffFile{O}() +if Base.VERSION >= v"1.6.0-dev" + include("precompile.jl") + _precompile_() +end + end # module diff --git a/src/precompile.jl b/src/precompile.jl new file mode 100644 index 00000000..3209e910 --- /dev/null +++ b/src/precompile.jl @@ -0,0 +1,114 @@ +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + Base.precompile(Tuple{typeof(load),String}) # time: 0.8531362 + Base.precompile(Tuple{typeof(save),String,Matrix{Gray{N0f8}}}) # time: 0.5170205 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.18825965 + Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.1723125 + Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.16171266 + Base.precompile(Tuple{typeof(save),String,Matrix{RGB{Float64}}}) # time: 0.15845765 + Base.precompile(Tuple{typeof(save),String,Matrix{Gray{Float64}}}) # time: 0.14648879 + Base.precompile(Tuple{typeof(save),String,Matrix{RGB{N0f8}}}) # time: 0.14353837 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Palette{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.11497961 + Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.113022365 + Base.precompile(Tuple{typeof(read),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.066944726 + Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.066800356 + Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{Gray{N0f8}, 2, UInt32, Matrix{Gray{N0f8}}}}) # time: 0.06479182 + Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{RGB{Float64}, 3, UInt32, Array{RGB{Float64}, 3}}}) # time: 0.060670342 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.045707714 + Base.precompile(Tuple{Type{DenseTaggedImage},Array{RGB{Float64}, 3}}) # time: 0.039014105 + Base.precompile(Tuple{typeof(read!),Matrix{Gray{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.032177236 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.03194977 + Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},IFD{UInt32}}) # time: 0.02842084 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.028321235 + Base.precompile(Tuple{typeof(==),Tag{UInt16},Tag{UInt16}}) # time: 0.025600746 + Base.precompile(Tuple{typeof(read!),Matrix{Palette{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02521157 + Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag{Vector{UInt16}}}) # time: 0.023760663 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float16}},Val{COMPRESSION_NONE}}) # time: 0.023287587 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGBA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.023152903 + Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float16}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.022414045 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Q0f7}},Val{COMPRESSION_NONE}}) # time: 0.022239514 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Float64}},Val{COMPRESSION_NONE}}) # time: 0.022171594 + Base.precompile(Tuple{typeof(read!),Matrix{RGBA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021391485 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.02123404 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float64}},Val{COMPRESSION_NONE}}) # time: 0.021200674 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021150375 + Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.021041602 + Base.precompile(Tuple{typeof(read!),Matrix{Gray{Q0f7}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020965552 + Base.precompile(Tuple{Type{PhotometricInterpretations},UInt16}) # time: 0.02094273 + Base.precompile(Tuple{typeof(read!),Matrix{Gray{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02027843 + Base.precompile(Tuple{typeof(read!),Matrix{RGB{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02018289 + Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02010488 + Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020045642 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Int64}}) # time: 0.018833784 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.016355174 + Base.precompile(Tuple{typeof(_constructifd),Matrix{GrayA{N0f8}},Type{UInt64}}) # time: 0.01615425 + Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag{Vector{Any}}}) # time: 0.014018073 + Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.013356887 + Base.precompile(Tuple{Type{CompressionType},UInt16}) # time: 0.013091691 + Base.precompile(Tuple{typeof(==),Tag{String},Tag{String}}) # time: 0.01298185 + Base.precompile(Tuple{typeof(==),Tag{UInt32},Tag{UInt32}}) # time: 0.012306561 + Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag{Rational{UInt32}}}) # time: 0.011322744 + Base.precompile(Tuple{typeof(==),Tag{Int64},Tag{Int64}}) # time: 0.009839917 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Vector{Any}}) # time: 0.009679591 + Base.precompile(Tuple{typeof(getindex),DenseTaggedImage{Gray{Q0f7}, 3, UInt32, Array{Gray{Q0f7}, 3}},Colon,Colon,Int64}) # time: 0.008461196 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.007452095 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.007410001 + Base.precompile(Tuple{typeof(load!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.007403022 + Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{String}}) # time: 0.006368029 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt64}}) # time: 0.006161459 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.005960559 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.005946236 + Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag}) # time: 0.005465424 + Base.precompile(Tuple{Type{SampleFormats},UInt16}) # time: 0.004940535 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}}}) # time: 0.004425628 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},BitMatrix,Val{COMPRESSION_NONE}}) # time: 0.004010168 + Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{Int64}}) # time: 0.003988138 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{Any},TiffTag}) # time: 0.003884544 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}}}) # time: 0.003710196 + Base.precompile(Tuple{Type{ExtraSamples},UInt16}) # time: 0.003669783 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Float32}},UInt16}) # time: 0.003473605 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Rational{UInt32}},UInt16}) # time: 0.003378185 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Any}},UInt16}) # time: 0.003339198 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt16}}) # time: 0.003337144 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Int64,TiffTag}) # time: 0.003330334 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt32}}) # time: 0.003281216 + Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{IFD}}) # time: 0.003261436 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.003118473 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{UInt32}},UInt16}) # time: 0.003060288 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Rational{UInt32}}},UInt16}) # time: 0.003004863 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String}}) # time: 0.002840864 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.002743712 + Base.precompile(Tuple{typeof(reversebits),UInt16}) # time: 0.002475895 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.002377102 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.002330324 + Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{GrayA{N0f8}},IFD{UInt64}}) # time: 0.002313145 + Base.precompile(Tuple{Type{TiffFile{UInt32, S} where S<:Stream}}) # time: 0.002307761 + Base.precompile(Tuple{typeof(delete!),IFD{UInt32},TiffTag}) # time: 0.00196244 + Base.precompile(Tuple{Type{TiffFile{UInt64, S} where S<:Stream}}) # time: 0.001846816 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Rational{UInt32}},Int64}) # time: 0.001842795 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}},Int64}) # time: 0.001810207 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.001809206 + Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag}) # time: 0.001804639 + Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag}) # time: 0.001744052 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Int64},Int64}) # time: 0.001742653 + Base.precompile(Tuple{Type{ExtraSamples},Int64}) # time: 0.001733948 + Base.precompile(Tuple{typeof(==),Tag{String},Tag}) # time: 0.001720252 + Base.precompile(Tuple{typeof(==),Tag{Int64},Tag}) # time: 0.001519996 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001491975 + Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{RGB{N0f16}},IFD{UInt32}}) # time: 0.0014855 + Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{4}}) # time: 0.001481642 + Base.precompile(Tuple{Type{Tag},UInt16,Vector{Float32}}) # time: 0.001394724 + Base.precompile(Tuple{typeof(read!),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.001387047 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001385259 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.001370888 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}},Int64}) # time: 0.001290415 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt16}) # time: 0.001252801 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt32}) # time: 0.001246271 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}},Int64}) # time: 0.001200158 + Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{2}}) # time: 0.001130745 + Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},UInt64}) # time: 0.001085022 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},ExtraSamples,TiffTag}) # time: 0.001067766 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String},Int64}) # time: 0.001026105 + Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Int64}) # time: 0.001022311 + Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{UInt32},TiffTag}) # time: 0.001012777 +end From 28080881b1e10d05304fa59140e8e0775a7706a9 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 2 Mar 2021 10:38:41 -0500 Subject: [PATCH 2/6] assert precompiles --- src/precompile.jl | 222 +++++++++++++++++++++++----------------------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/src/precompile.jl b/src/precompile.jl index 3209e910..c41fd42e 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -1,114 +1,114 @@ function _precompile_() ccall(:jl_generating_output, Cint, ()) == 1 || return nothing - Base.precompile(Tuple{typeof(load),String}) # time: 0.8531362 - Base.precompile(Tuple{typeof(save),String,Matrix{Gray{N0f8}}}) # time: 0.5170205 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.18825965 - Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.1723125 - Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.16171266 - Base.precompile(Tuple{typeof(save),String,Matrix{RGB{Float64}}}) # time: 0.15845765 - Base.precompile(Tuple{typeof(save),String,Matrix{Gray{Float64}}}) # time: 0.14648879 - Base.precompile(Tuple{typeof(save),String,Matrix{RGB{N0f8}}}) # time: 0.14353837 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Palette{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.11497961 - Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.113022365 - Base.precompile(Tuple{typeof(read),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.066944726 - Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.066800356 - Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{Gray{N0f8}, 2, UInt32, Matrix{Gray{N0f8}}}}) # time: 0.06479182 - Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{RGB{Float64}, 3, UInt32, Array{RGB{Float64}, 3}}}) # time: 0.060670342 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.045707714 - Base.precompile(Tuple{Type{DenseTaggedImage},Array{RGB{Float64}, 3}}) # time: 0.039014105 - Base.precompile(Tuple{typeof(read!),Matrix{Gray{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.032177236 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.03194977 - Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},IFD{UInt32}}) # time: 0.02842084 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.028321235 - Base.precompile(Tuple{typeof(==),Tag{UInt16},Tag{UInt16}}) # time: 0.025600746 - Base.precompile(Tuple{typeof(read!),Matrix{Palette{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02521157 - Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag{Vector{UInt16}}}) # time: 0.023760663 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float16}},Val{COMPRESSION_NONE}}) # time: 0.023287587 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGBA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.023152903 - Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float16}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.022414045 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Q0f7}},Val{COMPRESSION_NONE}}) # time: 0.022239514 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Float64}},Val{COMPRESSION_NONE}}) # time: 0.022171594 - Base.precompile(Tuple{typeof(read!),Matrix{RGBA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021391485 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.02123404 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float64}},Val{COMPRESSION_NONE}}) # time: 0.021200674 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021150375 - Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.021041602 - Base.precompile(Tuple{typeof(read!),Matrix{Gray{Q0f7}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020965552 - Base.precompile(Tuple{Type{PhotometricInterpretations},UInt16}) # time: 0.02094273 - Base.precompile(Tuple{typeof(read!),Matrix{Gray{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02027843 - Base.precompile(Tuple{typeof(read!),Matrix{RGB{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02018289 - Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02010488 - Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020045642 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Int64}}) # time: 0.018833784 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.016355174 - Base.precompile(Tuple{typeof(_constructifd),Matrix{GrayA{N0f8}},Type{UInt64}}) # time: 0.01615425 - Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag{Vector{Any}}}) # time: 0.014018073 - Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.013356887 - Base.precompile(Tuple{Type{CompressionType},UInt16}) # time: 0.013091691 - Base.precompile(Tuple{typeof(==),Tag{String},Tag{String}}) # time: 0.01298185 - Base.precompile(Tuple{typeof(==),Tag{UInt32},Tag{UInt32}}) # time: 0.012306561 - Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag{Rational{UInt32}}}) # time: 0.011322744 - Base.precompile(Tuple{typeof(==),Tag{Int64},Tag{Int64}}) # time: 0.009839917 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Vector{Any}}) # time: 0.009679591 - Base.precompile(Tuple{typeof(getindex),DenseTaggedImage{Gray{Q0f7}, 3, UInt32, Array{Gray{Q0f7}, 3}},Colon,Colon,Int64}) # time: 0.008461196 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.007452095 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.007410001 - Base.precompile(Tuple{typeof(load!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.007403022 - Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{String}}) # time: 0.006368029 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt64}}) # time: 0.006161459 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.005960559 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.005946236 - Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag}) # time: 0.005465424 - Base.precompile(Tuple{Type{SampleFormats},UInt16}) # time: 0.004940535 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}}}) # time: 0.004425628 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},BitMatrix,Val{COMPRESSION_NONE}}) # time: 0.004010168 - Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{Int64}}) # time: 0.003988138 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{Any},TiffTag}) # time: 0.003884544 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}}}) # time: 0.003710196 - Base.precompile(Tuple{Type{ExtraSamples},UInt16}) # time: 0.003669783 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Float32}},UInt16}) # time: 0.003473605 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Rational{UInt32}},UInt16}) # time: 0.003378185 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Any}},UInt16}) # time: 0.003339198 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt16}}) # time: 0.003337144 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Int64,TiffTag}) # time: 0.003330334 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt32}}) # time: 0.003281216 - Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{IFD}}) # time: 0.003261436 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.003118473 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{UInt32}},UInt16}) # time: 0.003060288 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Rational{UInt32}}},UInt16}) # time: 0.003004863 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String}}) # time: 0.002840864 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.002743712 - Base.precompile(Tuple{typeof(reversebits),UInt16}) # time: 0.002475895 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.002377102 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.002330324 - Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{GrayA{N0f8}},IFD{UInt64}}) # time: 0.002313145 - Base.precompile(Tuple{Type{TiffFile{UInt32, S} where S<:Stream}}) # time: 0.002307761 - Base.precompile(Tuple{typeof(delete!),IFD{UInt32},TiffTag}) # time: 0.00196244 - Base.precompile(Tuple{Type{TiffFile{UInt64, S} where S<:Stream}}) # time: 0.001846816 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Rational{UInt32}},Int64}) # time: 0.001842795 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}},Int64}) # time: 0.001810207 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.001809206 - Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag}) # time: 0.001804639 - Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag}) # time: 0.001744052 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Int64},Int64}) # time: 0.001742653 - Base.precompile(Tuple{Type{ExtraSamples},Int64}) # time: 0.001733948 - Base.precompile(Tuple{typeof(==),Tag{String},Tag}) # time: 0.001720252 - Base.precompile(Tuple{typeof(==),Tag{Int64},Tag}) # time: 0.001519996 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001491975 - Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{RGB{N0f16}},IFD{UInt32}}) # time: 0.0014855 - Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{4}}) # time: 0.001481642 - Base.precompile(Tuple{Type{Tag},UInt16,Vector{Float32}}) # time: 0.001394724 - Base.precompile(Tuple{typeof(read!),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.001387047 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001385259 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.001370888 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}},Int64}) # time: 0.001290415 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt16}) # time: 0.001252801 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt32}) # time: 0.001246271 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}},Int64}) # time: 0.001200158 - Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{2}}) # time: 0.001130745 - Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},UInt64}) # time: 0.001085022 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},ExtraSamples,TiffTag}) # time: 0.001067766 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String},Int64}) # time: 0.001026105 - Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Int64}) # time: 0.001022311 - Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{UInt32},TiffTag}) # time: 0.001012777 + @assert Base.precompile(Tuple{typeof(load),String}) # time: 0.8531362 + @assert Base.precompile(Tuple{typeof(save),String,Matrix{Gray{N0f8}}}) # time: 0.5170205 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.18825965 + @assert Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.1723125 + @assert Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.16171266 + @assert Base.precompile(Tuple{typeof(save),String,Matrix{RGB{Float64}}}) # time: 0.15845765 + @assert Base.precompile(Tuple{typeof(save),String,Matrix{Gray{Float64}}}) # time: 0.14648879 + @assert Base.precompile(Tuple{typeof(save),String,Matrix{RGB{N0f8}}}) # time: 0.14353837 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Palette{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.11497961 + @assert Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.113022365 + @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.066944726 + @assert Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.066800356 + @assert Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{Gray{N0f8}, 2, UInt32, Matrix{Gray{N0f8}}}}) # time: 0.06479182 + @assert Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{RGB{Float64}, 3, UInt32, Array{RGB{Float64}, 3}}}) # time: 0.060670342 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.045707714 + @assert Base.precompile(Tuple{Type{DenseTaggedImage},Array{RGB{Float64}, 3}}) # time: 0.039014105 + @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.032177236 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.03194977 + @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},IFD{UInt32}}) # time: 0.02842084 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.028321235 + @assert Base.precompile(Tuple{typeof(==),Tag{UInt16},Tag{UInt16}}) # time: 0.025600746 + @assert Base.precompile(Tuple{typeof(read!),Matrix{Palette{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02521157 + @assert Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag{Vector{UInt16}}}) # time: 0.023760663 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float16}},Val{COMPRESSION_NONE}}) # time: 0.023287587 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGBA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.023152903 + @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float16}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.022414045 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Q0f7}},Val{COMPRESSION_NONE}}) # time: 0.022239514 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Float64}},Val{COMPRESSION_NONE}}) # time: 0.022171594 + @assert Base.precompile(Tuple{typeof(read!),Matrix{RGBA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021391485 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.02123404 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float64}},Val{COMPRESSION_NONE}}) # time: 0.021200674 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021150375 + @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.021041602 + @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{Q0f7}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020965552 + @assert Base.precompile(Tuple{Type{PhotometricInterpretations},UInt16}) # time: 0.02094273 + @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02027843 + @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02018289 + @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02010488 + @assert Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020045642 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Int64}}) # time: 0.018833784 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.016355174 + @assert Base.precompile(Tuple{typeof(_constructifd),Matrix{GrayA{N0f8}},Type{UInt64}}) # time: 0.01615425 + @assert Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag{Vector{Any}}}) # time: 0.014018073 + @assert Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.013356887 + @assert Base.precompile(Tuple{Type{CompressionType},UInt16}) # time: 0.013091691 + @assert Base.precompile(Tuple{typeof(==),Tag{String},Tag{String}}) # time: 0.01298185 + @assert Base.precompile(Tuple{typeof(==),Tag{UInt32},Tag{UInt32}}) # time: 0.012306561 + @assert Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag{Rational{UInt32}}}) # time: 0.011322744 + @assert Base.precompile(Tuple{typeof(==),Tag{Int64},Tag{Int64}}) # time: 0.009839917 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Vector{Any}}) # time: 0.009679591 + @assert Base.precompile(Tuple{typeof(getindex),DenseTaggedImage{Gray{Q0f7}, 3, UInt32, Array{Gray{Q0f7}, 3}},Colon,Colon,Int64}) # time: 0.008461196 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.007452095 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.007410001 + @assert Base.precompile(Tuple{typeof(load!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.007403022 + @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{String}}) # time: 0.006368029 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt64}}) # time: 0.006161459 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.005960559 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.005946236 + @assert Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag}) # time: 0.005465424 + @assert Base.precompile(Tuple{Type{SampleFormats},UInt16}) # time: 0.004940535 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}}}) # time: 0.004425628 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},BitMatrix,Val{COMPRESSION_NONE}}) # time: 0.004010168 + @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{Int64}}) # time: 0.003988138 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{Any},TiffTag}) # time: 0.003884544 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}}}) # time: 0.003710196 + @assert Base.precompile(Tuple{Type{ExtraSamples},UInt16}) # time: 0.003669783 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Float32}},UInt16}) # time: 0.003473605 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Rational{UInt32}},UInt16}) # time: 0.003378185 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Any}},UInt16}) # time: 0.003339198 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt16}}) # time: 0.003337144 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Int64,TiffTag}) # time: 0.003330334 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt32}}) # time: 0.003281216 + @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{IFD}}) # time: 0.003261436 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.003118473 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{UInt32}},UInt16}) # time: 0.003060288 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Rational{UInt32}}},UInt16}) # time: 0.003004863 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String}}) # time: 0.002840864 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.002743712 + @assert Base.precompile(Tuple{typeof(reversebits),UInt16}) # time: 0.002475895 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.002377102 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.002330324 + @assert Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{GrayA{N0f8}},IFD{UInt64}}) # time: 0.002313145 + @assert Base.precompile(Tuple{Type{TiffFile{UInt32, S} where S<:Stream}}) # time: 0.002307761 + @assert Base.precompile(Tuple{typeof(delete!),IFD{UInt32},TiffTag}) # time: 0.00196244 + @assert Base.precompile(Tuple{Type{TiffFile{UInt64, S} where S<:Stream}}) # time: 0.001846816 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Rational{UInt32}},Int64}) # time: 0.001842795 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}},Int64}) # time: 0.001810207 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.001809206 + @assert Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag}) # time: 0.001804639 + @assert Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag}) # time: 0.001744052 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Int64},Int64}) # time: 0.001742653 + @assert Base.precompile(Tuple{Type{ExtraSamples},Int64}) # time: 0.001733948 + @assert Base.precompile(Tuple{typeof(==),Tag{String},Tag}) # time: 0.001720252 + @assert Base.precompile(Tuple{typeof(==),Tag{Int64},Tag}) # time: 0.001519996 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001491975 + @assert Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{RGB{N0f16}},IFD{UInt32}}) # time: 0.0014855 + @assert Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{4}}) # time: 0.001481642 + @assert Base.precompile(Tuple{Type{Tag},UInt16,Vector{Float32}}) # time: 0.001394724 + @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.001387047 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001385259 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.001370888 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}},Int64}) # time: 0.001290415 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt16}) # time: 0.001252801 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt32}) # time: 0.001246271 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}},Int64}) # time: 0.001200158 + @assert Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{2}}) # time: 0.001130745 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},UInt64}) # time: 0.001085022 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},ExtraSamples,TiffTag}) # time: 0.001067766 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String},Int64}) # time: 0.001026105 + @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Int64}) # time: 0.001022311 + @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{UInt32},TiffTag}) # time: 0.001012777 end From 4825d215cabe9f525c4f40773a57f6b331e4476d Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 2 Mar 2021 10:45:24 -0500 Subject: [PATCH 3/6] remove precompile that fails on nightly --- src/precompile.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/precompile.jl b/src/precompile.jl index c41fd42e..dcabd5d3 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -58,7 +58,6 @@ function _precompile_() @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt64}}) # time: 0.006161459 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.005960559 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.005946236 - @assert Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag}) # time: 0.005465424 @assert Base.precompile(Tuple{Type{SampleFormats},UInt16}) # time: 0.004940535 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}}}) # time: 0.004425628 @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},BitMatrix,Val{COMPRESSION_NONE}}) # time: 0.004010168 @@ -88,12 +87,8 @@ function _precompile_() @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Rational{UInt32}},Int64}) # time: 0.001842795 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}},Int64}) # time: 0.001810207 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.001809206 - @assert Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag}) # time: 0.001804639 - @assert Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag}) # time: 0.001744052 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Int64},Int64}) # time: 0.001742653 @assert Base.precompile(Tuple{Type{ExtraSamples},Int64}) # time: 0.001733948 - @assert Base.precompile(Tuple{typeof(==),Tag{String},Tag}) # time: 0.001720252 - @assert Base.precompile(Tuple{typeof(==),Tag{Int64},Tag}) # time: 0.001519996 @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001491975 @assert Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{RGB{N0f16}},IFD{UInt32}}) # time: 0.0014855 @assert Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{4}}) # time: 0.001481642 From 40e53cde1e6fe49f32c0785119884ca148f5f6a6 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 2 Mar 2021 13:12:12 -0500 Subject: [PATCH 4/6] set up codecov ignores --- codecov.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..20a4d310 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,4 @@ +ignore: + - "dev" + - "docs" + - "examples" From a2b91d5fbb3c16838e39eb7160e31bb90fc84d26 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 2 Mar 2021 15:21:04 -0500 Subject: [PATCH 5/6] use precompiles for 1.5.3 forward --- src/TiffImages.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TiffImages.jl b/src/TiffImages.jl index 36bd9961..0acb2149 100644 --- a/src/TiffImages.jl +++ b/src/TiffImages.jl @@ -31,7 +31,7 @@ include("load.jl") @deprecate TiffFile(::Type{O}) where O<:Unsigned TiffFile{O}() -if Base.VERSION >= v"1.6.0-dev" +if Base.VERSION >= v"1.5.3" include("precompile.jl") _precompile_() end From 424f528f814c9ea4c699314092fb73b1068a3dbf Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 3 Mar 2021 05:48:03 -0500 Subject: [PATCH 6/6] replace precompile directives with simpler precompile helper --- .gitignore | 2 +- codecov.yml | 1 - dev/precomp_gen.jl | 14 ------ dev/snooping.jl | 54 ---------------------- src/TiffImages.jl | 11 +++-- src/precompile.jl | 109 --------------------------------------------- 6 files changed, 9 insertions(+), 182 deletions(-) delete mode 100644 dev/precomp_gen.jl delete mode 100644 dev/snooping.jl delete mode 100644 src/precompile.jl diff --git a/.gitignore b/.gitignore index 3687fa47..2f4d3ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .DS_Store Manifest.toml -/dev/precomp_files/ +/dev/ docs/build/ docs/src/examples/ diff --git a/codecov.yml b/codecov.yml index 20a4d310..938ae4c2 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,4 +1,3 @@ ignore: - - "dev" - "docs" - "examples" diff --git a/dev/precomp_gen.jl b/dev/precomp_gen.jl deleted file mode 100644 index 5d3d5857..00000000 --- a/dev/precomp_gen.jl +++ /dev/null @@ -1,14 +0,0 @@ -using TiffImages -using TiffImages.ColorTypes: Gray, RGB -using TiffImages.FixedPointNumbers: N0f8 - -fpath = "test.tiff" -for t in [N0f8, Float64] - for typ in [Gray, RGB] - img = rand(typ{t}, 2, 2) - TiffImages.save(fpath, img) - img2 = TiffImages.load(fpath) - end -end - -include(joinpath(dirname(@__DIR__), "test", "runtests.jl")) diff --git a/dev/snooping.jl b/dev/snooping.jl deleted file mode 100644 index 36e89357..00000000 --- a/dev/snooping.jl +++ /dev/null @@ -1,54 +0,0 @@ -using SnoopCompile -import Pkg - -Pkg.activate(joinpath(dirname(@__DIR__), "test")) -Pkg.instantiate() -Pkg.precompile() - -@warn "Remember to comment out the precompile block at the end of the module first" - -tinf = @snoopi_deep include(joinpath(@__DIR__, "precomp_gen.jl")) - -ttot, pcs = SnoopCompile.parcel(tinf) - -pre_dir = joinpath(dirname(@__DIR__), "src") -temp_pre_dir = joinpath(@__DIR__, "precomp_files") - -SnoopCompile.write(temp_pre_dir, pcs) - -cp(joinpath(temp_pre_dir, "precompile_TiffImages.jl"), joinpath(pre_dir, "precompile.jl"), force=true) - -# Version 1.7.0-DEV.599 (2021-02-23) results - -# Test: no precompile statements out of 8.5968e-5 -# Base.Multimedia: no precompile statements out of 0.000275989 -# Base.SimdLoop: no precompile statements out of 0.000407908 -# Base.Order: no precompile statements out of 0.000536852 -# FileIO: no precompile statements out of 0.000550962 -# Markdown: no precompile statements out of 0.0006239080000000001 -# FixedPointNumbers: no precompile statements out of 0.001040202 -# ColorVectorSpace: no precompile statements out of 0.001379413 -# Logging: precompiled 0.001722304 out of 0.001722304 -# OffsetArrays: no precompile statements out of 0.002296208 -# Core: no precompile statements out of 0.0034895629999999998 -# LinearAlgebra: precompiled 0.0013803869999999998 out of 0.004956093999999999 -# InteractiveUtils: precompiled 0.00626247 out of 0.00626247 -# Base.Threads: precompiled 0.009569629 out of 0.009569629 -# SparseArrays: precompiled 0.012367197999999998 out of 0.012367197999999998 -# Base.Iterators: precompiled 0.012117240999999999 out of 0.012684179 -# ProgressMeter: precompiled 0.013705748 out of 0.013705748 -# Downloads: precompiled 0.014950076 out of 0.014950076 -# Base.Sort: precompiled 0.016226450999999996 out of 0.016226450999999996 -# Random: precompiled 0.017393442 out of 0.017393442 -# ColorTypes: precompiled 0.020498265 out of 0.023748921 -# Base.IteratorsMD: precompiled 0.035884334000000004 out of 0.03903587000000001 -# Documenter.DocMeta: precompiled 0.051472402 out of 0.051472402 -# Documenter.Utilities.Markdown2: precompiled 0.05216909700000002 out of 0.055926490000000016 -# ChainRulesCore: precompiled 0.06667838000000001 out of 0.06667838 -# Base.Broadcast: precompiled 0.124451302 out of 0.13479977599999995 -# DocStringExtensions: precompiled 0.2535032259999999 out of 0.25378781899999997 -# Documenter.DocTests: precompiled 0.3671079589999999 out of 0.36790237199999987 -# Documenter: precompiled 0.552544844 out of 0.552544844 -# Base: precompiled 0.5551221220000002 out of 0.6030158669999999 -# Documenter.Builder: precompiled 2.3401716290000003 out of 2.3410122970000007 -# TiffImages: precompiled 3.5842173639999997 out of 3.6049806520000005 diff --git a/src/TiffImages.jl b/src/TiffImages.jl index 0acb2149..021932ca 100644 --- a/src/TiffImages.jl +++ b/src/TiffImages.jl @@ -31,9 +31,14 @@ include("load.jl") @deprecate TiffFile(::Type{O}) where O<:Unsigned TiffFile{O}() -if Base.VERSION >= v"1.5.3" - include("precompile.jl") - _precompile_() +## Precompilation helper +mktemp() do fpath, _ + for t in [N0f8, N0f16, Float32, Float64] + for c in [Gray, GrayA, RGB, RGBA] + TiffImages.save(fpath, rand(c{t}, 2, 2)) + TiffImages.load(fpath) + end + end end end # module diff --git a/src/precompile.jl b/src/precompile.jl deleted file mode 100644 index dcabd5d3..00000000 --- a/src/precompile.jl +++ /dev/null @@ -1,109 +0,0 @@ -function _precompile_() - ccall(:jl_generating_output, Cint, ()) == 1 || return nothing - @assert Base.precompile(Tuple{typeof(load),String}) # time: 0.8531362 - @assert Base.precompile(Tuple{typeof(save),String,Matrix{Gray{N0f8}}}) # time: 0.5170205 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.18825965 - @assert Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.1723125 - @assert Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.16171266 - @assert Base.precompile(Tuple{typeof(save),String,Matrix{RGB{Float64}}}) # time: 0.15845765 - @assert Base.precompile(Tuple{typeof(save),String,Matrix{Gray{Float64}}}) # time: 0.14648879 - @assert Base.precompile(Tuple{typeof(save),String,Matrix{RGB{N0f8}}}) # time: 0.14353837 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Palette{N0f8}},Val{COMPRESSION_PACKBITS}}) # time: 0.11497961 - @assert Base.precompile(Tuple{Core.kwftype(typeof(load)),NamedTuple{(:verbose, :mmap), Tuple{Bool, Bool}},typeof(load),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}}}) # time: 0.113022365 - @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.066944726 - @assert Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{GrayA{N0f8}, 2, UInt64, Matrix{GrayA{N0f8}}}}) # time: 0.066800356 - @assert Base.precompile(Tuple{typeof(write),Stream{DataFormat{:TIFF}, IOStream},DenseTaggedImage{Gray{N0f8}, 2, UInt32, Matrix{Gray{N0f8}}}}) # time: 0.06479182 - @assert Base.precompile(Tuple{typeof(write),IOStream,DenseTaggedImage{RGB{Float64}, 3, UInt32, Array{RGB{Float64}, 3}}}) # time: 0.060670342 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.045707714 - @assert Base.precompile(Tuple{Type{DenseTaggedImage},Array{RGB{Float64}, 3}}) # time: 0.039014105 - @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.032177236 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.03194977 - @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},IFD{UInt32}}) # time: 0.02842084 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.028321235 - @assert Base.precompile(Tuple{typeof(==),Tag{UInt16},Tag{UInt16}}) # time: 0.025600746 - @assert Base.precompile(Tuple{typeof(read!),Matrix{Palette{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02521157 - @assert Base.precompile(Tuple{typeof(==),Tag{Vector{UInt16}},Tag{Vector{UInt16}}}) # time: 0.023760663 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float16}},Val{COMPRESSION_NONE}}) # time: 0.023287587 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGBA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.023152903 - @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float16}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.022414045 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Q0f7}},Val{COMPRESSION_NONE}}) # time: 0.022239514 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{Float64}},Val{COMPRESSION_NONE}}) # time: 0.022171594 - @assert Base.precompile(Tuple{typeof(read!),Matrix{RGBA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021391485 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{Gray{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.02123404 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Matrix{RGB{Float64}},Val{COMPRESSION_NONE}}) # time: 0.021200674 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.021150375 - @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{Tag}}) # time: 0.021041602 - @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{Q0f7}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020965552 - @assert Base.precompile(Tuple{Type{PhotometricInterpretations},UInt16}) # time: 0.02094273 - @assert Base.precompile(Tuple{typeof(read!),Matrix{Gray{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02027843 - @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02018289 - @assert Base.precompile(Tuple{typeof(read!),Matrix{RGB{Float64}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.02010488 - @assert Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt32}}) # time: 0.020045642 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Int64}}) # time: 0.018833784 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.016355174 - @assert Base.precompile(Tuple{typeof(_constructifd),Matrix{GrayA{N0f8}},Type{UInt64}}) # time: 0.01615425 - @assert Base.precompile(Tuple{typeof(==),Tag{Vector{Any}},Tag{Vector{Any}}}) # time: 0.014018073 - @assert Base.precompile(Tuple{typeof(read!),Matrix{GrayA{N0f8}},TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.013356887 - @assert Base.precompile(Tuple{Type{CompressionType},UInt16}) # time: 0.013091691 - @assert Base.precompile(Tuple{typeof(==),Tag{String},Tag{String}}) # time: 0.01298185 - @assert Base.precompile(Tuple{typeof(==),Tag{UInt32},Tag{UInt32}}) # time: 0.012306561 - @assert Base.precompile(Tuple{typeof(==),Tag{Rational{UInt32}},Tag{Rational{UInt32}}}) # time: 0.011322744 - @assert Base.precompile(Tuple{typeof(==),Tag{Int64},Tag{Int64}}) # time: 0.009839917 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Vector{Any}}) # time: 0.009679591 - @assert Base.precompile(Tuple{typeof(getindex),DenseTaggedImage{Gray{Q0f7}, 3, UInt32, Array{Gray{Q0f7}, 3}},Colon,Colon,Int64}) # time: 0.008461196 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.007452095 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},IFD{UInt64}}) # time: 0.007410001 - @assert Base.precompile(Tuple{typeof(load!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},IFD{UInt32}}) # time: 0.007403022 - @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{String}}) # time: 0.006368029 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt64}}) # time: 0.006161459 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.005960559 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.005946236 - @assert Base.precompile(Tuple{Type{SampleFormats},UInt16}) # time: 0.004940535 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}}}) # time: 0.004425628 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},BitMatrix,Val{COMPRESSION_NONE}}) # time: 0.004010168 - @assert Base.precompile(Tuple{typeof(show),IOContext{IOBuffer},Tag{Int64}}) # time: 0.003988138 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{Any},TiffTag}) # time: 0.003884544 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}}}) # time: 0.003710196 - @assert Base.precompile(Tuple{Type{ExtraSamples},UInt16}) # time: 0.003669783 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Float32}},UInt16}) # time: 0.003473605 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Rational{UInt32}},UInt16}) # time: 0.003378185 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Any}},UInt16}) # time: 0.003339198 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt16}}) # time: 0.003337144 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Int64,TiffTag}) # time: 0.003330334 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{UInt32}}) # time: 0.003281216 - @assert Base.precompile(Tuple{typeof(read),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Type{IFD}}) # time: 0.003261436 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String}}) # time: 0.003118473 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{UInt32}},UInt16}) # time: 0.003060288 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Tag{Vector{Rational{UInt32}}},UInt16}) # time: 0.003004863 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String}}) # time: 0.002840864 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.002743712 - @assert Base.precompile(Tuple{typeof(reversebits),UInt16}) # time: 0.002475895 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt16}}) # time: 0.002377102 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{UInt32}}) # time: 0.002330324 - @assert Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{GrayA{N0f8}},IFD{UInt64}}) # time: 0.002313145 - @assert Base.precompile(Tuple{Type{TiffFile{UInt32, S} where S<:Stream}}) # time: 0.002307761 - @assert Base.precompile(Tuple{typeof(delete!),IFD{UInt32},TiffTag}) # time: 0.00196244 - @assert Base.precompile(Tuple{Type{TiffFile{UInt64, S} where S<:Stream}}) # time: 0.001846816 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Rational{UInt32}},Int64}) # time: 0.001842795 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{UInt32}},Int64}) # time: 0.001810207 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}}}) # time: 0.001809206 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Int64},Int64}) # time: 0.001742653 - @assert Base.precompile(Tuple{Type{ExtraSamples},Int64}) # time: 0.001733948 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001491975 - @assert Base.precompile(Tuple{Type{DenseTaggedImage},Matrix{RGB{N0f16}},IFD{UInt32}}) # time: 0.0014855 - @assert Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{4}}) # time: 0.001481642 - @assert Base.precompile(Tuple{Type{Tag},UInt16,Vector{Float32}}) # time: 0.001394724 - @assert Base.precompile(Tuple{typeof(read!),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOStream}},Matrix{GrayA{N0f8}},Val{COMPRESSION_NONE}}) # time: 0.001387047 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{String},Int64}) # time: 0.001385259 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},Rational{UInt32}}) # time: 0.001370888 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{Vector{Any}},Int64}) # time: 0.001290415 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt16}) # time: 0.001252801 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},UInt32}) # time: 0.001246271 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOStream}},Tag{Vector{UInt16}},Int64}) # time: 0.001200158 - @assert Base.precompile(Tuple{typeof(interpretation),PhotometricInterpretations,ExtraSamples,Val{2}}) # time: 0.001130745 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt64, Stream{DataFormat{:TIFF}, IOBuffer}},UInt64}) # time: 0.001085022 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},ExtraSamples,TiffTag}) # time: 0.001067766 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Tag{String},Int64}) # time: 0.001026105 - @assert Base.precompile(Tuple{typeof(write),TiffFile{UInt32, Stream{DataFormat{:TIFF}, IOBuffer}},Int64}) # time: 0.001022311 - @assert Base.precompile(Tuple{typeof(setindex!),IFD{UInt32},Vector{UInt32},TiffTag}) # time: 0.001012777 -end