diff --git a/src/Bridges/Bridges.jl b/src/Bridges/Bridges.jl index aa64f050ea..94aca12688 100644 --- a/src/Bridges/Bridges.jl +++ b/src/Bridges/Bridges.jl @@ -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 diff --git a/src/Bridges/Constraint/Constraint.jl b/src/Bridges/Constraint/Constraint.jl index 3b9dde2c7a..13ab9bdb12 100644 --- a/src/Bridges/Constraint/Constraint.jl +++ b/src/Bridges/Constraint/Constraint.jl @@ -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 diff --git a/src/Bridges/Constraint/precompile.jl b/src/Bridges/Constraint/precompile.jl new file mode 100644 index 0000000000..3ad8076980 --- /dev/null +++ b/src/Bridges/Constraint/precompile.jl @@ -0,0 +1,81 @@ +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonnegatives, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.048389416 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.SingleVariable,MathOptInterface.AbstractScalarSet}) # time: 0.03299137 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}} where {T, F<:MathOptInterface.SingleVariable}}) # time: 0.02840943 + Base.precompile(Tuple{typeof(has_bridges),Map}) # time: 0.013614236 + Base.precompile(Tuple{typeof(variable_constraints),Map,MathOptInterface.VariableIndex}) # time: 0.010480635 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.Interval{Float64}}}}) # time: 0.007661137 + Base.precompile(Tuple{typeof(empty!),Map}) # time: 0.007576335 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{SplitIntervalBridge{Float64, MathOptInterface.SingleVariable, MathOptInterface.Interval{Float64}, MathOptInterface.GreaterThan{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.007041929 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{SquareBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeTriangle, MathOptInterface.PositiveSemidefiniteConeSquare}}}) # time: 0.006890723 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{VectorSlackBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}}) # time: 0.006461247 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}}) # time: 0.006377854 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{SquareBridge{Float64, MathOptInterface.VectorOfVariables, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeTriangle, MathOptInterface.PositiveSemidefiniteConeSquare}}}) # time: 0.006344027 + # TODO: Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{T}}}) # time: 0.005965137 + # TODO: Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{T}}}) # time: 0.005906573 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorFunctionizeBridge{Float64, MathOptInterface.Nonpositives}}}) # time: 0.005836183 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{SplitIntervalBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}, MathOptInterface.GreaterThan{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.005833324 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarizeBridge{Float64, MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}}) # time: 0.005829607 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{SplitIntervalBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.Interval{Float64}, MathOptInterface.GreaterThan{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.005761993 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{GreaterToIntervalBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.00575148 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorFunctionizeBridge{Float64, MathOptInterface.PositiveSemidefiniteConeSquare}}}) # time: 0.00574405 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarFunctionizeBridge{Float64, MathOptInterface.GreaterThan{Float64}}}}) # time: 0.00567841 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarFunctionizeBridge{Float64, MathOptInterface.LessThan{Float64}}}}) # time: 0.005579188 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonnegatives, MathOptInterface.SingleVariable}}}) # time: 0.005479757 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{NonposToNonnegBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.VectorAffineFunction{Float64}}}}) # time: 0.00540064 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarizeBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.005361762 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{LessToGreaterBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.SingleVariable}}}) # time: 0.00535649 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.005323451 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constrained_variable_types),Type{VectorSlackBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonpositives}}}) # time: 0.005278666 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{NonnegToNonposBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.VectorOfVariables}}}) # time: 0.005213201 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.005212731 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonpositives, MathOptInterface.SingleVariable}}}) # time: 0.00519287 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarizeBridge{Float64, MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}}) # time: 0.005168288 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorFunctionizeBridge{Float64, MathOptInterface.Nonnegatives}}}) # time: 0.00512054 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{GreaterToLessBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.005100022 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{NonposToNonnegBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.VectorOfVariables}}}) # time: 0.005093382 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{LessToIntervalBridge{Float64, MathOptInterface.SingleVariable}}}) # time: 0.005061132 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{LessToIntervalBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.005032025 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{GreaterToLessBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.SingleVariable}}}) # time: 0.005014173 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{GreaterToIntervalBridge{Float64, MathOptInterface.SingleVariable}}}) # time: 0.004949188 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonpositives, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.00493602 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarFunctionizeBridge{Float64, MathOptInterface.Interval{Float64}}}}) # time: 0.00493321 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{LessToGreaterBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarAffineFunction{Float64}}}}) # time: 0.004918501 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}) # time: 0.004912217 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorFunctionizeBridge{Float64, MathOptInterface.PositiveSemidefiniteConeTriangle}}}) # time: 0.004706224 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, _A} where _A}) # time: 0.003971573 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}} where {T, F<:Union{MathOptInterface.SingleVariable, MathOptInterface.VectorOfVariables}}}) # time: 0.003837313 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorOfVariables,MathOptInterface.AbstractVectorSet}) # time: 0.003170592 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}} where {T, F<:MathOptInterface.SingleVariable}}) # time: 0.002960819 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonnegatives, MathOptInterface.SingleVariable},MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}) # time: 0.002900157 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}} where {T, F<:Union{MathOptInterface.SingleVariable, MathOptInterface.VectorOfVariables}}}) # time: 0.00279975 + Base.precompile(Tuple{typeof(haskey),Map,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.002708187 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros, MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.EqualTo{Float64}}) # time: 0.002476458 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,VectorizeBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonnegatives, MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.GreaterThan{Float64}}) # time: 0.002441077 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,SquareBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeTriangle, MathOptInterface.PositiveSemidefiniteConeSquare},MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.PositiveSemidefiniteConeSquare}) # time: 0.00238164 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,VectorFunctionizeBridge{Float64, MathOptInterface.PositiveSemidefiniteConeTriangle},MathOptInterface.VectorOfVariables,MathOptInterface.PositiveSemidefiniteConeTriangle}) # time: 0.002314156 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorSlackBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}}) # time: 0.002269375 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,LessToGreaterBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.LessThan{Float64}}) # time: 0.002267911 + Base.precompile(Tuple{typeof(haskey),Map,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F}}) # time: 0.00218399 + Base.precompile(Tuple{typeof(vector_of_variables_constraints),Map}) # time: 0.001941289 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.001907838 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}}) # time: 0.0017095 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorOfVariables,MathOptInterface.AbstractSet}) # time: 0.001644976 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.SingleVariable,MathOptInterface.AbstractSet}) # time: 0.001513536 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.AbstractSet}) # time: 0.001489506 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}}) # time: 0.00147503 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{ScalarSlackBridge{Float64, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.Interval{Float64}}}}) # time: 0.001448391 + # TODO: Base.precompile(Tuple{typeof(delete!),Map,Union{MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{T}}}}) # time: 0.001438713 + Base.precompile(Tuple{typeof(MathOptInterface.Bridges.added_constraint_types),Type{VectorSlackBridge{Float64, MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Nonpositives}}}) # time: 0.001423358 + Base.precompile(Tuple{typeof(haskey),Map,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.001388763 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.EqualTo{Float64}}) # time: 0.001372888 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.AbstractFunction,MathOptInterface.AbstractSet}) # time: 0.001332999 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.ScalarAffineFunction{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.AbstractSet}) # time: 0.001300738 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Zeros}) # time: 0.001159031 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.SecondOrderCone}) # time: 0.001082412 + Base.precompile(Tuple{typeof(delete!),Map,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.001056021 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Nonnegatives}) # time: 0.001055006 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.PositiveSemidefiniteConeSquare}) # time: 0.00105328 + Base.precompile(Tuple{typeof(add_key_for_bridge),Map,AbstractBridge,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.PositiveSemidefiniteConeTriangle}) # time: 0.001016888 +end diff --git a/src/Bridges/Objective/Objective.jl b/src/Bridges/Objective/Objective.jl index 7a033b78c4..1ebdc245a7 100644 --- a/src/Bridges/Objective/Objective.jl +++ b/src/Bridges/Objective/Objective.jl @@ -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 diff --git a/src/Bridges/Objective/precompile.jl b/src/Bridges/Objective/precompile.jl new file mode 100644 index 0000000000..b35eed2db7 --- /dev/null +++ b/src/Bridges/Objective/precompile.jl @@ -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 diff --git a/src/Bridges/Variable/Variable.jl b/src/Bridges/Variable/Variable.jl index aa6a2a1199..ba22f76db7 100644 --- a/src/Bridges/Variable/Variable.jl +++ b/src/Bridges/Variable/Variable.jl @@ -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 diff --git a/src/Bridges/Variable/precompile.jl b/src/Bridges/Variable/precompile.jl new file mode 100644 index 0000000000..cf2359d76e --- /dev/null +++ b/src/Bridges/Variable/precompile.jl @@ -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 diff --git a/src/Bridges/precompile.jl b/src/Bridges/precompile.jl new file mode 100644 index 0000000000..17ec895b3f --- /dev/null +++ b/src/Bridges/precompile.jl @@ -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 diff --git a/src/MathOptInterface.jl b/src/MathOptInterface.jl index 99bd6291f5..0991baa69b 100644 --- a/src/MathOptInterface.jl +++ b/src/MathOptInterface.jl @@ -149,4 +149,9 @@ include("FileFormats/FileFormats.jl") include("instantiate.jl") +if Base.VERSION >= v"1.4.2" + include("precompile.jl") + _precompile_() +end + end diff --git a/src/Utilities/Utilities.jl b/src/Utilities/Utilities.jl index c52d20e5ec..9c88e839a3 100644 --- a/src/Utilities/Utilities.jl +++ b/src/Utilities/Utilities.jl @@ -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 diff --git a/src/Utilities/precompile.jl b/src/Utilities/precompile.jl new file mode 100644 index 0000000000..b954d4b401 --- /dev/null +++ b/src/Utilities/precompile.jl @@ -0,0 +1,162 @@ +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + isdefined(MathOptInterface.Utilities, Symbol("#165#171")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#165#171")),DataType}) # time: 1.4558948 + Base.precompile(Tuple{typeof(broadcastvcat),Function,Model{Float64}}) # time: 1.4121648 + Base.precompile(Tuple{typeof(MathOptInterface.delete),UniversalFallback{Model{Float64}},MathOptInterface.VariableIndex}) # time: 1.1493027 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraints}) # time: 0.21186654 + Base.precompile(Tuple{typeof(MathOptInterface.empty!),UniversalFallback{Model{Float64}}}) # time: 0.122432366 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}) # time: 0.12199785 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.VectorOfVariables, MathOptInterface.PositiveSemidefiniteConeTriangle}}) # time: 0.10004706 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.VectorOfVariables,MathOptInterface.AbstractVectorSet}) # time: 0.099981986 + Base.precompile(Tuple{typeof(keys),IndexMap}) # time: 0.09508495 + Base.precompile(Tuple{typeof(MathOptInterface.optimize!),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}}}) # time: 0.08862922 + Base.precompile(Tuple{typeof(operate),typeof(*),Type{Float64},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.079366356 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.VectorAffineFunction{Float64}}) # time: 0.07101885 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.062484402 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfVariableIndices}) # time: 0.056865256 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.055448838 + # TODO: Base.precompile(Tuple{typeof(operate_output_index!),typeof(+),Core.Type{T},Int64,MathOptInterface.VectorAffineFunction{T},MathOptInterface.ScalarAffineFunction{T}}) # time: 0.049536582 + Base.precompile(Tuple{typeof(operate_output_index!),typeof(+),Type{Float64},Int64,MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.04774441 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.SecondOrderCone}}) # time: 0.04695538 + # TODO: Base.precompile(Tuple{typeof(operate_output_index!),typeof(+),Core.Type{T},Int64,MathOptInterface.VectorQuadraticFunction{T},MathOptInterface.ScalarAffineFunction{T}}) # time: 0.045612343 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}) # time: 0.04524842 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}) # time: 0.04296505 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.LazyConstraintCallback,Function}) # time: 0.04126309 + Base.precompile(Tuple{typeof(MathOptInterface.modify),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarCoefficientChange{Float64}}) # time: 0.037959184 + Base.precompile(Tuple{typeof(map_indices),Function,MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.03368791 + Base.precompile(Tuple{typeof(delete!),IndexMap,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.03231516 + Base.precompile(Tuple{typeof(MathOptInterface.add_variables),UniversalFallback{Model{Float64}},Any}) # time: 0.031159803 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.ScalarAffineFunction{MathOptInterface.ScalarAffineFunction{Float64}}}) # time: 0.03082883 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfVariableAttributesSet}) # time: 0.029612781 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.SingleVariable,MathOptInterface.AbstractScalarSet}) # time: 0.027166696 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.DualStatus}) # time: 0.026211431 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.PrimalStatus}) # time: 0.025897125 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.Silent,Bool}) # time: 0.025886275 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.025841229 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{_A, _B} where {_A, _B}}) # time: 0.025434624 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.VariableName,MathOptInterface.VariableIndex,String}) # time: 0.02458812 + Base.precompile(Tuple{typeof(operate),typeof(-),Type{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.SingleVariable}) # time: 0.023819331 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.VectorOfVariables}) # time: 0.023671608 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.Interval{Float64}}}) # time: 0.020710003 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}},String}) # time: 0.020317951 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.AbstractFunction,MathOptInterface.AbstractSet}) # time: 0.020015607 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.ScalarAffineFunction{_A} where _A,MathOptInterface.AbstractSet}) # time: 0.019851033 + Base.precompile(Tuple{typeof(MathOptInterface.delete),UniversalFallback{Model{Float64}},Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.018373866 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.ScalarAffineFunction{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.AbstractSet}) # time: 0.016342334 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintSet,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{T}} where T}) # time: 0.014742568 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.PositiveSemidefiniteConeTriangle}) # time: 0.012966506 + Base.precompile(Tuple{typeof(getindex),ScalarFunctionIterator{MathOptInterface.VectorAffineFunction{Float64}},Int64}) # time: 0.012782512 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.AbstractScalarFunction}) # time: 0.011779644 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{T}} where T}) # time: 0.01177635 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.AbstractSet}) # time: 0.011083066 + # TODO: Base.precompile(Tuple{typeof(operate),typeof(-),Core.Type{T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)},T<:(MathOptInterface.ScalarAffineFunction{_A} where _A),MathOptInterface.SingleVariable}) # time: 0.010697476 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{T}} where T}) # time: 0.010508736 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.009982171 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.009751869 + Base.precompile(Tuple{typeof(MathOptInterface.delete),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.009529631 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}},String}) # time: 0.009372859 + Base.precompile(Tuple{typeof(getindex),ScalarFunctionIterator{MathOptInterface.VectorAffineFunction{Float64}},Vector{Int64}}) # time: 0.009297068 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.NLPBlock,MathOptInterface.NLPBlockData}) # time: 0.009188253 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ObjectiveSense,MathOptInterface.OptimizationSense}) # time: 0.009152894 + Base.precompile(Tuple{typeof(map_indices),IndexMap,MathOptInterface.ScalarAffineFunction{_A} where _A}) # time: 0.008855449 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}},String}) # time: 0.008473215 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.UserCutCallback,Function}) # time: 0.00811491 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfModelAttributesSet}) # time: 0.008045145 + # TODO: Base.precompile(Tuple{typeof(setindex!),IndexMap,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S},MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S}}) # time: 0.007972478 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ObjectiveFunction{MathOptInterface.SingleVariable}}) # time: 0.007827095 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.HeuristicCallback,Function}) # time: 0.007820415 + Base.precompile(Tuple{typeof(map_indices),Function,MathOptInterface.ScalarQuadraticTerm{Float64}}) # time: 0.007779868 + # TODO: Base.precompile(Tuple{typeof(operate),typeof(-),Core.Type{T},MathOptInterface.ScalarAffineFunction{T},MathOptInterface.SingleVariable}) # time: 0.007589532 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F}}) # time: 0.007550623 + Base.precompile(Tuple{typeof(MathOptInterface.set),UniversalFallback{Model{Float64}},MathOptInterface.ObjectiveFunction,MathOptInterface.ScalarAffineFunction{_A} where _A}) # time: 0.007418556 + Base.precompile(Tuple{typeof(map_indices),Function,MathOptInterface.ScalarQuadraticFunction{Float64}}) # time: 0.006926228 + Base.precompile(Tuple{typeof(map_indices),IndexMap,Vector{MathOptInterface.VariableIndex}}) # time: 0.006504927 + Base.precompile(Tuple{typeof(map_indices),Function,MathOptInterface.VectorAffineFunction{Float64}}) # time: 0.006169203 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, _A} where _A}) # time: 0.006143256 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.006133721 + # TODO: Base.precompile(Tuple{typeof(operate_output_index!),typeof(+),Core.Type{T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)},Int64,MathOptInterface.VectorAffineFunction{T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)},T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)}) # time: 0.005806269 + isdefined(MathOptInterface.Utilities, Symbol("#166#172")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#166#172")),DataType}) # time: 0.005533174 + Base.precompile(Tuple{typeof(operate!),typeof(+),Type{Float64},MathOptInterface.ScalarQuadraticFunction{Float64},MathOptInterface.ScalarQuadraticFunction{Float64}}) # time: 0.005454123 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfOptimizerAttributesSet}) # time: 0.005238003 + Base.precompile(Tuple{typeof(delete!),IndexMap,MathOptInterface.VariableIndex}) # time: 0.005049041 + Base.precompile(Tuple{typeof(MathOptInterface.delete),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, S} where S}) # time: 0.00496782 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintFunction,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.004443296 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.AbstractOptimizerAttribute}) # time: 0.004368742 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{_A, _B} where {_A, _B}}) # time: 0.0043292 + # TODO: Base.precompile(Tuple{Core.kwftype(typeof(normalize_constant)),NamedTuple{(:allow_modify_function,), Tuple{Bool}},typeof(normalize_constant),Union{MathOptInterface.ScalarAffineFunction{T}, MathOptInterface.ScalarQuadraticFunction{T}},MathOptInterface.AbstractScalarSet}) # time: 0.004154197 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.004114619 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ObjectiveFunction{MathOptInterface.SingleVariable},MathOptInterface.SingleVariable}) # time: 0.004089465 + Base.precompile(Tuple{typeof(operate!),typeof(+),Type{Float64},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.004055656 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.003774213 + Base.precompile(Tuple{typeof(getindex),IndexMap,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F<:MathOptInterface.AbstractScalarFunction}}) # time: 0.003678685 + Base.precompile(Tuple{typeof(operate),typeof(*),Type{Float64},Float64,MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.003466153 + Base.precompile(Tuple{typeof(operate!),typeof(*),Type{Float64},MathOptInterface.ScalarQuadraticFunction{Float64},Float64}) # time: 0.003435623 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.VectorOfVariables,MathOptInterface.Nonnegatives}) # time: 0.003421846 + Base.precompile(Tuple{typeof(MathOptInterface.set),UniversalFallback{Model{Float64}},MathOptInterface.ObjectiveFunction,MathOptInterface.AbstractScalarFunction}) # time: 0.003342248 + Base.precompile(Tuple{typeof(isapprox_zero),MathOptInterface.ScalarAffineFunction{Float64},Float64}) # time: 0.003337314 + Base.precompile(Tuple{typeof(operate!),typeof(+),Type{Float64},MathOptInterface.ScalarQuadraticFunction{Float64},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.003279901 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}) # time: 0.003153471 + Base.precompile(Tuple{typeof(getindex),IndexMap,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, S} where S}) # time: 0.003147332 + Base.precompile(Tuple{typeof(MathOptInterface.is_valid),UniversalFallback{Model{Float64}},MathOptInterface.VariableIndex}) # time: 0.003063951 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.003004704 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Nonnegatives}) # time: 0.002920673 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}) # time: 0.002901544 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.SingleVariable, MathOptInterface.EqualTo{Float64}}}) # time: 0.002896252 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.SingleVariable, MathOptInterface.ZeroOne}}) # time: 0.002891152 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintIndices{MathOptInterface.SingleVariable, MathOptInterface.Integer}}) # time: 0.002888883 + Base.precompile(Tuple{typeof(MathOptInterface.modify),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}},MathOptInterface.ScalarCoefficientChange{Float64}}) # time: 0.002811431 + Base.precompile(Tuple{typeof(MathOptInterface.add_constraint),UniversalFallback{Model{Float64}},MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.Zeros}) # time: 0.002725057 + Base.precompile(Tuple{typeof(MathOptInterface.set),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.ScalarAffineFunction{Float64}}) # time: 0.002560265 + Base.precompile(Tuple{typeof(index_map_for_variable_indices),Vector{MathOptInterface.VariableIndex}}) # time: 0.002516896 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.NLPBlock}) # time: 0.002506225 + Base.precompile(Tuple{typeof(haskey),IndexMap,MathOptInterface.ConstraintIndex}) # time: 0.002464554 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.HeuristicCallback}) # time: 0.002410447 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.LazyConstraintCallback}) # time: 0.002387894 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintSet,MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.PositiveSemidefiniteConeTriangle}}) # time: 0.002289546 + Base.precompile(Tuple{Core.kwftype(typeof(normalize_constant)),NamedTuple{(:allow_modify_function,), Tuple{Bool}},typeof(normalize_constant),MathOptInterface.ScalarAffineFunction{MathOptInterface.ScalarAffineFunction{Float64}},MathOptInterface.AbstractScalarSet}) # time: 0.002264879 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.Integer}}) # time: 0.002199597 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.Semicontinuous{Float64}}}) # time: 0.002120947 + Base.precompile(Tuple{typeof(delete!),IndexMap,MathOptInterface.ConstraintIndex{_A, _B} where {_A, _B}}) # time: 0.002118063 + # TODO: Base.precompile(Tuple{typeof(setindex!),IndexMap,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, S},MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, S}}) # time: 0.002073167 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.Semiinteger{Float64}}}) # time: 0.002064088 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.GreaterThan{Float64}}}) # time: 0.002040845 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.UserCutCallback}) # time: 0.002039284 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),Any}) # time: 0.002022543 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}) # time: 0.002003081 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.ZeroOne}}) # time: 0.001982808 + Base.precompile(Tuple{typeof(_add_contraint_type),Vector{Tuple{DataType, DataType}},Model{Float64},Type{MathOptInterface.LessThan{Float64}}}) # time: 0.001954173 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.VariableBridgingCost}) # time: 0.001767792 + Base.precompile(Tuple{typeof(getindex),IndexMap,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, S} where S}) # time: 0.00175013 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.SecondOrderCone}}) # time: 0.001641073 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.001637458 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.VectorOfVariables, MathOptInterface.PositiveSemidefiniteConeTriangle}}) # time: 0.001616716 + Base.precompile(Tuple{typeof(operate),typeof(-),Type{Float64},MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.SingleVariable}) # time: 0.001598086 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.001546691 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ConstraintSet,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.EqualTo{Float64}}}) # time: 0.001534907 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}) # time: 0.001512601 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.SingleVariable, MathOptInterface.GreaterThan{Float64}}}) # time: 0.001501434 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.PositiveSemidefiniteConeSquare}}) # time: 0.001470739 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}) # time: 0.001470722 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.SingleVariable, MathOptInterface.ZeroOne}}) # time: 0.001447509 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.VariableName,MathOptInterface.VariableIndex}) # time: 0.001442049 + # TODO: Base.precompile(Tuple{typeof(operate_output_index!),typeof(+),Core.Type{T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)},Int64,MathOptInterface.VectorQuadraticFunction{T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)},T<:(MathOptInterface.ScalarAffineFunction{_A} where _A)}) # time: 0.001415966 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.SingleVariable, MathOptInterface.Integer}}) # time: 0.001401716 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.SingleVariable, MathOptInterface.EqualTo{Float64}}}) # time: 0.001396837 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.00138956 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ListOfConstraintAttributesSet{MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}) # time: 0.001385637 + Base.precompile(Tuple{typeof(MathOptInterface.get),UniversalFallback{Model{Float64}},MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarAffineFunction{Float64}}}) # time: 0.001348312 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.001345947 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.SecondOrderCone}}) # time: 0.001335296 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.PositiveSemidefiniteConeTriangle}}) # time: 0.00123058 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}) # time: 0.001227755 + Base.precompile(Tuple{Core.kwftype(typeof(normalize_constant)),NamedTuple{(:allow_modify_function,), Tuple{Bool}},typeof(normalize_constant),MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.AbstractScalarSet}) # time: 0.001179703 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.ConstraintName,MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}) # time: 0.001132447 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}) # time: 0.001115607 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.ZeroOne}}) # time: 0.001113076 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}) # time: 0.001087792 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.Integer}}) # time: 0.001086164 + Base.precompile(Tuple{typeof(MathOptInterface.get),CachingOptimizer{MathOptInterface.AbstractOptimizer, UniversalFallback{Model{Float64}}},MathOptInterface.NumberOfVariables}) # time: 0.001085694 + isdefined(MathOptInterface.Utilities, Symbol("#145#147")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#145#147")),MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable, MathOptInterface.LessThan{Float64}}}) # time: 0.001064242 + Base.precompile(Tuple{typeof(getindex),IndexMap,Union{MathOptInterface.ConstraintIndex{F, MathOptInterface.GreaterThan{T}}, MathOptInterface.ConstraintIndex{F, MathOptInterface.LessThan{T}}} where {T, F}}) # time: 0.001060553 + isdefined(MathOptInterface.Utilities, Symbol("#166#172")) && Base.precompile(Tuple{getfield(MathOptInterface.Utilities, Symbol("#166#172")),Type}) # time: 0.00104939 +end diff --git a/src/precompile.jl b/src/precompile.jl new file mode 100644 index 0000000000..52116b4263 --- /dev/null +++ b/src/precompile.jl @@ -0,0 +1,114 @@ +const __bodyfunction__ = Dict{Method,Any}() + +# Find keyword "body functions" (the function that contains the body +# as written by the developer, called after all missing keyword-arguments +# have been assigned values), in a manner that doesn't depend on +# gensymmed names. +# `mnokw` is the method that gets called when you invoke it without +# supplying any keywords. +function __lookup_kwbody__(mnokw::Method) + function getsym(arg) + isa(arg, Symbol) && return arg + @assert isa(arg, GlobalRef) + return arg.name + end + + f = get(__bodyfunction__, mnokw, nothing) + if f === nothing + fmod = mnokw.module + # The lowered code for `mnokw` should look like + # %1 = mkw(kwvalues..., #self#, args...) + # return %1 + # where `mkw` is the name of the "active" keyword body-function. + ast = Base.uncompressed_ast(mnokw) + if isa(ast, Core.CodeInfo) && length(ast.code) >= 2 + callexpr = ast.code[end-1] + if isa(callexpr, Expr) && callexpr.head == :call + fsym = callexpr.args[1] + if isa(fsym, Symbol) + f = getfield(fmod, fsym) + elseif isa(fsym, GlobalRef) + if fsym.mod === Core && fsym.name === :_apply + f = getfield(mnokw.module, getsym(callexpr.args[2])) + elseif fsym.mod === Core && fsym.name === :_apply_iterate + f = getfield(mnokw.module, getsym(callexpr.args[3])) + else + f = getfield(fsym.mod, fsym.name) + end + else + f = missing + end + else + f = missing + end + else + f = missing + end + __bodyfunction__[mnokw] = f + end + return f +end + +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},VariablePrimalStart,Vector{VariableIndex}}) # time: 0.07465396 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{VectorOfVariables, PositiveSemidefiniteConeTriangle}}}) # time: 0.06941362 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{_A} where _A}) # time: 0.06315293 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{VectorAffineFunction{Float64}, PositiveSemidefiniteConeSquare}}}) # time: 0.062237397 + let fbody = try __lookup_kwbody__(which(instantiate, (Type,))) catch missing end + if !ismissing(fbody) + precompile(fbody, (Type{Float64},Bool,typeof(instantiate),Type,)) + end + end # time: 0.05891838 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, GreaterThan{Float64}}}}) # time: 0.051366724 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, EqualTo{Float64}}}}) # time: 0.05011797 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{SingleVariable, Integer}}}) # time: 0.047489766 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{SingleVariable, ZeroOne}}}) # time: 0.043587953 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{VectorOfVariables, PositiveSemidefiniteConeTriangle}}}) # time: 0.04207921 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{ScalarQuadraticFunction{Float64}, LessThan{Float64}}}}) # time: 0.041189477 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{VectorAffineFunction{Float64}, PositiveSemidefiniteConeSquare}}}) # time: 0.039949134 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{VectorAffineFunction{Float64}, SecondOrderCone}}}) # time: 0.036591787 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{SingleVariable, GreaterThan{Float64}}}}) # time: 0.034482736 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, LessThan{Float64}}}}) # time: 0.032348134 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{VectorAffineFunction{Float64}, SecondOrderCone}}}) # time: 0.031941403 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{ScalarQuadraticFunction{Float64}, LessThan{Float64}}}}) # time: 0.029012412 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, EqualTo{Float64}}}}) # time: 0.028307851 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{SingleVariable, GreaterThan{Float64}}}}) # time: 0.0268003 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{SingleVariable, LessThan{Float64}}}}) # time: 0.026435265 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintFunction,Vector{ConstraintIndex{SingleVariable, EqualTo{Float64}}}}) # time: 0.026390325 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{SingleVariable, LessThan{Float64}}}}) # time: 0.025676165 + # TODO: Base.precompile(Tuple{Type{VectorQuadraticFunction},Core.Array{MathOptInterface.VectorAffineTerm{T}, 1},Core.Array{MathOptInterface.VectorQuadraticTerm{T}, 1},Core.Array{T, 1}}) # time: 0.02562763 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, GreaterThan{Float64}}}}) # time: 0.024989743 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{SingleVariable, Integer}}}) # time: 0.024261666 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, LessThan{Float64}}}}) # time: 0.024140714 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{SingleVariable, ZeroOne}}}) # time: 0.023562236 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},ConstraintSet,Vector{ConstraintIndex{SingleVariable, EqualTo{Float64}}}}) # time: 0.023147725 + Base.precompile(Tuple{Type{VectorAffineFunction{Float64}},VectorOfVariables}) # time: 0.020000555 + Base.precompile(Tuple{typeof(convert),Type{VectorAffineFunction{Float64}},SingleVariable}) # time: 0.008697798 + Base.precompile(Tuple{typeof(convert),Type{VectorAffineFunction{Float64}},ScalarAffineFunction{Float64}}) # time: 0.007289221 + Base.precompile(Tuple{typeof(convert),Type{ScalarAffineFunction{_A}} where _A,SingleVariable}) # time: 0.007221313 + Base.precompile(Tuple{typeof(convert),Type{ScalarAffineFunction{Float64}},SingleVariable}) # time: 0.006756334 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{VectorAffineFunction{Float64}, PositiveSemidefiniteConeSquare}}}) # time: 0.00662328 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractVariableAttribute,Vector{VariableIndex}}) # time: 0.006028682 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{VectorAffineFunction{Float64}, SecondOrderCone}}}) # time: 0.005972562 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{ScalarQuadraticFunction{Float64}, LessThan{Float64}}}}) # time: 0.00574646 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{VectorOfVariables, PositiveSemidefiniteConeTriangle}}}) # time: 0.005563445 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Array{ConstraintIndex{F, S}, 1} where {F, S}}) # time: 0.005523676 + # TODO: Base.precompile(Tuple{Type{VectorAffineFunction},Core.Array{MathOptInterface.VectorAffineTerm{T}, 1},Core.Array{T, 1}}) # time: 0.005085834 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{SingleVariable, EqualTo{Float64}}}}) # time: 0.00483048 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, EqualTo{Float64}}}}) # time: 0.004200286 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{SingleVariable, ZeroOne}}}) # time: 0.003953963 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, GreaterThan{Float64}}}}) # time: 0.00390162 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{SingleVariable, Integer}}}) # time: 0.003883528 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{SingleVariable, GreaterThan{Float64}}}}) # time: 0.003878481 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{ScalarAffineFunction{Float64}, LessThan{Float64}}}}) # time: 0.003820131 + Base.precompile(Tuple{typeof(get),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},AbstractConstraintAttribute,Vector{ConstraintIndex{SingleVariable, LessThan{Float64}}}}) # time: 0.00379635 + Base.precompile(Tuple{typeof(add_constrained_variables),MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}},Reals}) # time: 0.003498349 + Base.precompile(Tuple{Type{InvalidIndex},Union{ConstraintIndex{F, GreaterThan{T}}, ConstraintIndex{F, LessThan{T}}} where {T, F<:AbstractScalarFunction}}) # time: 0.002815791 + Base.precompile(Tuple{Type{InvalidIndex},ConstraintIndex{SingleVariable, S} where S}) # time: 0.001883546 + Base.precompile(Tuple{Type{InvalidIndex},ConstraintIndex{VectorOfVariables, S} where S}) # time: 0.001882338 + Base.precompile(Tuple{Type{SetAttributeNotAllowed},ObjectiveFunction}) # time: 0.001743249 + # TODO: Base.precompile(Tuple{Type{LessThan},T<:Core.Real}) # time: 0.001174288 + # TODO: Base.precompile(Tuple{Type{GreaterThan},T<:Core.Real}) # time: 0.001148143 + Base.precompile(Tuple{Type{SetAttributeNotAllowed},ObjectiveSense}) # time: 0.001080585 +end