Skip to content

Conversation

odow
Copy link
Member

@odow odow commented May 13, 2021

Big reduction in the amount of compiled code and the elimination of a type instability (the compiler couldn't prove the type in map due to FS....

Before

julia> using MathOptInterface

julia> const MOI = MathOptInterface
MathOptInterface

julia> using GLPK

julia> model = MOI.Bridges.full_bridge_optimizer(GLPK.Optimizer(), Float64)
MOIB.LazyBridgeOptimizer{GLPK.Optimizer}
with 0 variable bridges
with 0 constraint bridges
with 0 objective bridges
with inner model A GLPK model

julia> @time MOI.get(model, MOI.ListOfConstraintTypesPresent())
  1.158660 seconds (3.68 M allocations: 215.417 MiB, 12.50% gc time)
Tuple{DataType, DataType}[]

julia> @time MOI.get(model, MOI.ListOfConstraintTypesPresent())
  0.000021 seconds (11 allocations: 1.016 KiB)
Tuple{DataType, DataType}[]

After

julia> using MathOptInterface

julia> const MOI = MathOptInterface
MathOptInterface

julia> using GLPK

julia> model = MOI.Bridges.full_bridge_optimizer(GLPK.Optimizer(), Float64)
MOIB.LazyBridgeOptimizer{GLPK.Optimizer}
with 0 variable bridges
with 0 constraint bridges
with 0 objective bridges
with inner model A GLPK model

julia> @time MOI.get(model, MOI.ListOfConstraintTypesPresent())
  0.896201 seconds (2.82 M allocations: 162.893 MiB, 13.97% gc time)
Tuple{DataType, DataType}[]

julia> @time MOI.get(model, MOI.ListOfConstraintTypesPresent())
  0.000007 seconds (5 allocations: 688 bytes)
Tuple{DataType, DataType}[]

@odow odow added Submodule: Bridges About the Bridges submodule Type: Performance labels May 13, 2021
@odow odow merged commit e8320d2 into master May 13, 2021
@odow odow deleted the od/simplify-bridges branch May 13, 2021 20:51
@blegat blegat added this to the v0.10 milestone May 22, 2021
@blegat blegat modified the milestones: v0.10, v0.9.22 May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants