-
Notifications
You must be signed in to change notification settings - Fork 15
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
performance issue #115
Comments
It actually seems like there are less allocations in HiGHS? Is adding variables a bottleneck in a real use-case? |
This isn't overhead in HiGHS.jl, it's the cost in the underlying solver: julia> import HiGHS
julia> const MOI = HiGHS.MOI
MathOptInterface
julia> function main(N)
highs = HiGHS.Optimizer()
MOI.add_variables(highs, N)
return highs
end
main (generic function with 1 method)
julia> @time main(10_000)
0.026619 seconds (10.04 k allocations: 962.594 KiB)
A HiGHS model with 10000 columns and 0 rows.
julia> @time main(100_000)
1.644493 seconds (100.05 k allocations: 8.870 MiB)
A HiGHS model with 100000 columns and 0 rows.
julia> function bar(N)
highs = HiGHS.Highs_create()
for _ in 1:N
HiGHS.Highs_addCol(highs, 0.0, -Inf, Inf, 0, C_NULL, C_NULL)
end
HiGHS.Highs_destroy(highs)
return
end
bar (generic function with 1 method)
julia> @time bar(10_000)
0.023322 seconds
julia> @time bar(100_000)
1.671258 seconds |
Thank you for digging into the issue. |
In HiGHS.jl v1.0.0 or HiGHS the solver? |
I can do it. I'm just testing some different things |
Closing in favor of ERGO-Code/HiGHS#830 |
Hi,
I noticed adding variables for HiGHS solver is very slow compare to cplex solver. It seems there is a lot of allocations going on. Below is the code:
using HiGHS
using CPLEX
import MathOptInterface as MOI
highs_model=HiGHS.Optimizer()
cplex_model=CPLEX.Optimizer()
@time MOI.add_variables(highs_model,100000)
1.811086 seconds (100.01 k allocations: 8.694 MiB, 7.26% gc time)
@time MOI.add_variables(cplex_model,100000)
0.011854 seconds (400.01 k allocations: 15.561 MiB)
The text was updated successfully, but these errors were encountered: