Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/Bridges/Bridges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,9 @@ function Base.show(io::IO, B::AbstractBridgeOptimizer)
end
end

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end # module
5 changes: 5 additions & 0 deletions src/Bridges/Constraint/Constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ function add_all_bridges(bridged_model, ::Type{T}) where {T}
return
end

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end
81 changes: 81 additions & 0 deletions src/Bridges/Constraint/precompile.jl

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/Bridges/Objective/Objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ function add_all_bridges(bridged_model, T::Type)
return
end

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end
18 changes: 18 additions & 0 deletions src/Bridges/Objective/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
# TODO: This is a weird one! Base.precompile(Tuple{typeof(bridge_objective),Type,MathOptInterface.Bridges.LazyBridgeOptimizer,MathOptInterface.SingleVariable}) # time: 0.30286795
Base.precompile(Tuple{typeof(add_key_for_bridge),Map,SlackBridge,MathOptInterface.ScalarAffineFunction{_A} where _A}) # time: 0.044725213
Base.precompile(Tuple{typeof(empty!),Map}) # time: 0.008765762
Base.precompile(Tuple{typeof(add_key_for_bridge),Map,SlackBridge{_A, _B, MathOptInterface.ScalarAffineFunction{Float64}} where {_A, _B<:MathOptInterface.AbstractScalarFunction},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.007551381
Base.precompile(Tuple{typeof(root_bridge),Map}) # time: 0.005157664
Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.AbstractScalarFunction}) # time: 0.00417067
# TODO: Base.precompile(Tuple{typeof(MathOptInterface.get),MathOptInterface.Bridges.LazyBridgeOptimizer,MathOptInterface.Bridges.ObjectiveFunctionValue,Any}) # time: 0.003866515
Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarAffineFunction{Float64}}}) # time: 0.003800716
Base.precompile(Tuple{typeof(add_key_for_bridge),Map,FunctionizeBridge{Float64},MathOptInterface.SingleVariable}) # time: 0.002634435
# TODO: Base.precompile(Tuple{Core.Type{MathOptInterface.Bridges.Objective.SlackBridge{T, F<:MathOptInterface.AbstractScalarFunction, G<:MathOptInterface.AbstractScalarFunction}},MathOptInterface.VariableIndex,Any}) # time: 0.002627885
# TODO: Base.precompile(Tuple{Core.Type{MathOptInterface.Bridges.Objective.SlackBridge{T, F<:MathOptInterface.AbstractScalarFunction, MathOptInterface.SingleVariable}},MathOptInterface.VariableIndex,Any}) # time: 0.002619257
Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ObjectiveFunction{MathOptInterface.SingleVariable}}) # time: 0.001380728
Base.precompile(Tuple{typeof(concrete_bridge_type),MathOptInterface.Bridges.AbstractBridgeOptimizer,Type{MathOptInterface.ScalarAffineFunction{Float64}}}) # time: 0.001237356
# TODO: Base.precompile(Tuple{Core.Type{MathOptInterface.Bridges.Objective.SlackBridge{T, F<:MathOptInterface.AbstractScalarFunction, G<:MathOptInterface.AbstractScalarFunction}},MathOptInterface.VariableIndex,MathOptInterface.ConstraintIndex}) # time: 0.001100836
# TODO: Base.precompile(Tuple{Core.Type{MathOptInterface.Bridges.Objective.SlackBridge{T, F<:MathOptInterface.AbstractScalarFunction, MathOptInterface.ScalarAffineFunction{Core.Float64}}},MathOptInterface.VariableIndex,MathOptInterface.ConstraintIndex}) # time: 0.001085293
end
5 changes: 5 additions & 0 deletions src/Bridges/Variable/Variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,9 @@ function add_all_bridges(bridged_model, T::Type)
return
end

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end
29 changes: 29 additions & 0 deletions src/Bridges/Variable/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}) # time: 0.04609538
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, _A} where _A}) # time: 0.021449305
Base.precompile(Tuple{typeof(empty!),Map}) # time: 0.012949045
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonnegatives}}) # time: 0.00983498
Base.precompile(Tuple{typeof(delete!),Map,MathOptInterface.VariableIndex}) # time: 0.009456781
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, _A} where _A}) # time: 0.009078153
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.EqualTo{Float64}}}) # time: 0.008405447
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.SecondOrderCone}}) # time: 0.00831034
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros}}) # time: 0.008290234
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeTriangle}}) # time: 0.008019037
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, _A} where _A}) # time: 0.007693966
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.Integer}}) # time: 0.007498911
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.ZeroOne}}) # time: 0.007342877
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{MathOptInterface.ScalarAffineFunction{Float64}}, _A} where _A}) # time: 0.007312434
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}) # time: 0.007245695
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.007072676
Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{VectorizeBridge{Float64, MathOptInterface.Nonnegatives}}}) # time: 0.005922131
Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{NonposToNonnegBridge{Float64}}}) # time: 0.005914195
Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{VectorizeBridge{Float64, MathOptInterface.Nonpositives}}}) # time: 0.00547066
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}) # time: 0.005176492
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}) # time: 0.004830495
Base.precompile(Tuple{typeof(register_context),Map,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.00478906
Base.precompile(Tuple{typeof(unbridged_function),Map,MathOptInterface.VariableIndex}) # time: 0.002940502
Base.precompile(Tuple{Type{VectorizeBridge{Float64, _A}} where _A,Any,Any,Float64}) # time: 0.002500584
Base.precompile(Tuple{typeof(function_for),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.001794881
# TODO: Base.precompile(Tuple{typeof(unbridged_map),MathOptInterface.Bridges.Variable.VectorizeBridge{T, S} where S,MathOptInterface.VariableIndex}) # time: 0.001506648
end
16 changes: 16 additions & 0 deletions src/Bridges/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
Base.precompile(Tuple{typeof(unbridged_function),LazyBridgeOptimizer,MathOptInterface.AbstractScalarFunction}) # time: 0.6265791
Base.precompile(Tuple{typeof(bridge_index),Graph,ObjectiveNode}) # time: 0.03183784
Base.precompile(Tuple{typeof(_functionize_bridge),Vector{Any},Type{MathOptInterface.Bridges.Constraint.VectorFunctionizeBridge}}) # time: 0.007451239
Base.precompile(Tuple{typeof(_functionize_bridge),Vector{Any},Type{MathOptInterface.Bridges.Constraint.ScalarFunctionizeBridge}}) # time: 0.005963241
Base.precompile(Tuple{typeof(_functionize_bridge),Vector{Any},Type{MathOptInterface.Bridges.Objective.FunctionizeBridge}}) # time: 0.005938126
Base.precompile(Tuple{typeof(add_variable_node),Graph}) # time: 0.004315477
Base.precompile(Tuple{typeof(add_objective_node),Graph}) # time: 0.002944378
isdefined(MathOptInterface.Bridges, Symbol("#38#39")) && Base.precompile(Tuple{getfield(MathOptInterface.Bridges, Symbol("#38#39")),Nothing}) # time: 0.001879857
Base.precompile(Tuple{typeof(add_edge),Graph,ObjectiveNode,ObjectiveEdge}) # time: 0.001630966
Base.precompile(Tuple{typeof(add_edge),Graph,ConstraintNode,Edge}) # time: 0.001597607
Base.precompile(Tuple{typeof(_first_functionize_bridge),Vector{Any},Type{MathOptInterface.Bridges.Constraint.ScalarFunctionizeBridge}}) # time: 0.001491107
Base.precompile(Tuple{typeof(_first_functionize_bridge),Vector{Any},Type{MathOptInterface.Bridges.Constraint.VectorFunctionizeBridge}}) # time: 0.001170406
Base.precompile(Tuple{typeof(bridged_function),LazyBridgeOptimizer,Any}) # time: 0.001030499
end
5 changes: 5 additions & 0 deletions src/MathOptInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,9 @@ include("FileFormats/FileFormats.jl")

include("instantiate.jl")

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end
5 changes: 5 additions & 0 deletions src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ include("universalfallback.jl")

include("lazy_iterators.jl")

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end # module
Loading