Skip to content
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

Cache TerminationStatus to fix performance #205

Merged
merged 1 commit into from
Sep 8, 2022
Merged

Conversation

odow
Copy link
Member

@odow odow commented Sep 8, 2022

Closes #204

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Base: 58.93% // Head: 58.97% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (b1fdec9) compared to base (da62d14).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #205      +/-   ##
==========================================
+ Coverage   58.93%   58.97%   +0.04%     
==========================================
  Files           3        3              
  Lines         526      529       +3     
==========================================
+ Hits          310      312       +2     
- Misses        216      217       +1     
Impacted Files Coverage Δ
src/MOI_wrapper/MOI_wrapper.jl 86.94% <100.00%> (-0.22%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@odow
Copy link
Member Author

odow commented Sep 8, 2022

(cbc) pkg> st
      Status `/private/tmp/cbc/Project.toml`
  [9961bab8] Cbc v1.0.1 `~/.julia/dev/Cbc`
  [4076af6c] JuMP v1.3.0

julia> using JuMP

julia> import Cbc

julia> function main(M)
           model = Model(Cbc.Optimizer)
           set_silent(model)
           @variable(model, x[1:2M], Int)
           @variable(model, y[1:7_800M])
           optimize!(model)
           @time sol = value.(all_variables(model))
           return sol
       end
main (generic function with 1 method)

julia> @time main(10);
  0.036092 seconds (858.24 k allocations: 19.263 MiB)
  0.162443 seconds (1.58 M allocations: 76.591 MiB, 10.14% compilation time)

julia> @time main(100);
  0.449334 seconds (8.58 M allocations: 181.622 MiB, 15.22% gc time)
  2.001931 seconds (15.61 M allocations: 642.915 MiB, 15.17% gc time)

@odow odow merged commit 7116f02 into master Sep 8, 2022
@odow odow deleted the od/cache-term-status branch September 8, 2022 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

JuMP.value() Performance Issue
1 participant