-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
Description
using JuMP
using BenchmarkTools
function with_bin(N)
model = Model()
x = @variable(model, [1:N], Bin)
return x
end
function without_bin(N)
model = Model()
x = @variable(model, [1:N])
return x
end
@btime with_bin(1_000_000)
@btime without_bin(1_000_000)
JuMP master
, Julia 1.0.1:
930.520 ms (6000340 allocations: 950.56 MiB)
184.530 ms (2000252 allocations: 87.93 MiB)
JuMP 0.18, Julia 1.0.1:
60.050 ms (1000168 allocations: 79.79 MiB)
102.381 ms (1000168 allocations: 79.79 MiB)
(don't ask me to explain why binary variables are created faster than nonbinary variables on 0.18, it's very weird).
blegat