Skip to content
Merged
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
6 changes: 6 additions & 0 deletions perf/time_to_first_solve/script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,9 @@ if length(ARGS) > 0
end
exit(0)
end

# using SnoopCompileCore
# tinf = @snoopi_deep example_diet(Clp.Optimizer, true)
# using SnoopCompile, ProfileView
# fg = flamegraph(tinf)
# ProfileView.view(fg)
4 changes: 4 additions & 0 deletions src/Bridges/Bridges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,8 @@ function Base.show(io::IO, B::AbstractBridgeOptimizer)
return
end

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

end
14 changes: 14 additions & 0 deletions src/Bridges/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
Base.precompile(
full_bridge_optimizer,
(MOI.AbstractOptimizer, Type{Float64}),
)
Base.precompile(
unbridged_function,
(LazyBridgeOptimizer, MOI.AbstractScalarFunction),
) # time: 0.1381832
return
end

_precompile_()
1 change: 1 addition & 0 deletions src/Utilities/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ function _precompile_()
CachingOptimizer{MOI.AbstractOptimizer,UniversalFallback{Model{T}}},
constraints,
)
Base.precompile(UniversalFallback, (Model{T},))
return
end
2 changes: 1 addition & 1 deletion src/Utilities/universalfallback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mutable struct UniversalFallback{MT} <: MOI.ModelLike
return new{typeof(model)}(
model,
nothing,
OrderedDict{Tuple{Type,Type},OrderedDict}(),
OrderedDict{Type,OrderedDict}(),
OrderedDict{Tuple{Type,Type},VectorOfConstraints}(),
Dict{MOI.ConstraintIndex,String}(),
nothing,
Expand Down