-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add precompilation workflows with PrecompileTools.jl #9
Comments
Based on tests I've created a However I don't really see any speedup (in tests) since most of the time is spent in should we pursuit this further? |
in comparison: julia> using Pkg; @time using BangBang; @time Pkg.test("BangBang"); @time Pkg.test("BangBang"); reports:
vs baseline:
|
Hm yeah I guess that makes sense. What happens if you dont include dataframes? |
If I comment both zygote and dataframes tests take here
Unless we find some nice (and useful) workload, I'd rather not do it due to much increased precompile times... the content of import PrecompileTools
PrecompileTools.@setup_workload begin
xs = [1, 2, 3]
PrecompileTools.@compile_workload begin
add!!(1, 2)
add!!((1,), (2,))
add!!([1], [2])
# add!!(SVector(1), SVector(2))
# add!!(SVector(1), [2])
# add!!([1], SVector(2))
add!!([1], [0.5])
append!!([0.0], [1.0])
append!!([0], [1.0])
append!!([0], (1.0,))
append!!((0,), (1,))
append!!((a=0,), pairs((b=1,)))
append!!(Base.ImmutableDict(:a => 1), Base.ImmutableDict(:b => 2))
append!!("a", "b")
# append!!(SVector(0), [1])::Vector
# append!!([0], SVector(1))::Vector
append!!(Union{}[], Iterators.take(1:10, 3))
append!!(SingletonVector(1), [0.5, 2])
append!!(xs, InitialValue(append!!))
append!!(InitialValue(append!!), xs)
append!!(InitialValue(append!!), (x for x in xs if true))
append!!(InitialValue(append!!), InitialValue(append!!))
broadcast!!(+, xs, zeros(Int, 3), 1)
broadcast!!(+, xs, [1, 2, 3], 0.5)
Extras.broadcast_inplace!!(+, xs, 1)
Extras.broadcast_inplace!!(+, xs, [1, 2, 3], 0.5)
for unsafe in [false, true]
n = 10
for (label, src) in [
"vector" => 1:n,
"generator" => (x + 1 for x in 1:n),
"filter" => (x for x in 1:n if isodd(x)),
]
data = Vector{Int}(undef, n)
c = collector(data, Val(unsafe))
finish!(append!!(c, src))
end
end
c1 = append!!(collector(), [1, 2])
c2 = append!!(collector(), [3, 4, 5])
finish!(append!!(c1, c2))
delete!!(Dict(:a => 1), :a)
delete!!((a=1,), :a)
empty!!((1, 2, 3))
empty!!((a=1, b=2, c=3))
empty!!([1, 2, 3])
lmul!!(1, 2)
A = LowerTriangular(reshape(1:4, 2, 2))
B = ones(2, 2)
lmul!!(A, B)
A = LowerTriangular(collect(Float64, reshape(1:4, 2, 2)))
B = ones(Int, 2, 2)
AB = A * B
lmul!!(A, B)
a0 = Real[1:3;]
a = copy(a0)
b = [0im] .+ (1:3)
materialize!!(a, air.(a .+ b))
for (args, desired) in Any[
((Dict(:a => 1), Dict(:b => 0.5)), Dict(:a => 1.0, :b => 0.5)),
((Dict(:a => 1), Dict("b" => 2)), Dict(:a => 1, "b" => 2)),
((Dict(:a => 1), Dict("b" => 0.5)), Dict(:a => 1.0, "b" => 0.5)),
(((a=1,), (b=2,)), (a=1, b=2)),
(((a=1,), Dict(:b => 2)), (a=1, b=2)),
(((a=1,), Dict(:b => 2), (b=3,)), (a=1, b=3)),
((Empty(Dict), Dict(:a => 1)), Dict(:a => 1)),
# ((Empty(Dict), SingletonDict(:a => 1)), Dict(:a => 1)),
# ((SingletonDict(:a => 1), Dict(:b => 2)), Dict(:a => 1, :b => 2)),
# ((SingletonDict(:a => 1), Dict(:a => 2)), Dict(:a => 2)),
((+, Dict(:a => 1), Dict(:a => 0.5)), Dict(:a => 1.5)),
((+, (a=1,), Dict(:a => 0.5)), (a=1.5,)),
]
merge!!(args...)
end
for (args, desired) in Any[
((Dict(:a => 1), Dict(:b => 2)), Dict(:a => 1, :b => 2)),
((Dict(:a => 1), (b=2,)), Dict(:a => 1, :b => 2)),
((+, Dict(:a => 1), Dict(:a => 2)), Dict(:a => 3)),
((+, Dict(:a => 1), (a=2,)), Dict(:a => 3)),
((+, Dict(:a => 1), (a=2,), Dict(:a => 3)), Dict(:a => 6)),
]
merge!!(args...)
end
mul!!(0, 1, 2)
mul!!(missing, 1, 2)
mul!!(nothing, 1, 2)
C = zeros(2, 2)
A = reshape(1:4, 2, 2)
B = ones(2, 2)
mul!!(C, A, B)
C = zeros(Int, size(A * B))
mul!!(C, A, B)
pop!!([0, 1])
pop!!((0, 1))
pop!!((a=0, b=1))
# pop!!(SVector(0, 1))
pop!!(Dict(:a => 1), :a)
pop!!((a=1,), :a)
pop!!(Dict(:a => 1), :a, nothing)
popfirst!!([0, 1])
popfirst!!((0, 1))
popfirst!!((a=0, b=1))
# popfirst!!(SVector(0, 1))
push!!([0.0], 1.0)
push!!([0], 1.0, 2im, UInt(3))
push!!([0], 1.0)
push!!((0,), 1)
NoBang.push((0,), 1)
push!!((0,), 1.0, 2im, UInt(3))
NoBang.push((0,), 1.0, 2im, UInt(3))
push!!((a=0,), :b => 1)
push!!((a=0,), Val(:b) => 1)
# push!!(SVector(0), 1)
# push!!(SVector(0), 0.5)
push!!(Base.ImmutableDict(:a => 1), :b => 2)
push!!(Dict(), :a => 1)::Dict{Any,Any}
push!!(Dict{Union{},Union{}}(), :a => 1)::Dict{Symbol,Int}
push!!(Set(), 1)::Set{Any}
push!!(Set{Union{}}(), 1)::Set{Int}
pushfirst!!([0.0], 1.0)
pushfirst!!([0], 1.0)
pushfirst!!((0,), 1)
# pushfirst!!(SVector(0), 1)
# pushfirst!!(SVector(0), 1)
rmul!!(1, 2)
A = collect(Float64, reshape(1:4, 2, 2))
B = UpperTriangular(ones(2, 2))
rmul!!(A, B)
A = collect(Int, reshape(1:4, 2, 2))
B = UpperTriangular(ones(2, 2))
rmul!!(A, B)::Matrix{Float64}
setdiff!!([0], [0])
setdiff!!([0], (0,))
setdiff!!([0, 1, 2], (0,), [1])
setdiff!!(Set([0]), [0])
setdiff!!(Set([0]), (0,))
setdiff!!(Set([0, 1, 2]), Set([0]), [1])
setdiff!!(Empty(Vector), [])
setdiff!!(Empty(Set{Int}), [])
# setfield?
setindex!!((1, 2, 3), :two, 2)
setindex!!((a=1, b=2, c=3), :two, :b)
setindex!!([1, 2, 3], :two, 2)
setindex!!(Dict{Symbol,Int}(:a => 1, :b => 2), 10, :a)
setindex!!(Dict{Symbol,Int}(:a => 1, :b => 2), 3, "c")
setproperty!!((a=1, b=nothing), :b, 2)
splice!!((1, 2, 3), 2)
splice!!([1, 2, 3], 2)
splice!!([1, 2, 3], 2, 20)
splice!!((1, 2, 3), 2, 20)
splice!!([1, 2, 3], 2:3)
splice!!([1, 2, 3], 2:3, [20, 30])
# splice!!(SVector(1, 2, 3), 2)
# splice!!(SVector(1, 2, 3), 2, 20)
union!!([0.0], [1.0])
union!!([0], [0.5])
union!!(Set([0.0]), [1.0])
union!!(Set([0]), [0.5])
union!!(Empty(Set), [0])
union!!(Empty(Set), SingletonVector(0))
union!!(Set([0]), InitialValue(union!!))
unique!!([3, 2, 1, 2, 3])
end
end |
A nice beginner task for someone looking to help out would be to use PrecompileTools.jl to speed up the TTFX of this package.
The text was updated successfully, but these errors were encountered: