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

Use copy instead of deepcopy in MOIU model #567

Merged
merged 3 commits into from
Nov 12, 2018
Merged

Conversation

blegat
Copy link
Member

@blegat blegat commented Nov 12, 2018

In the benchmark of #566 (comment):

Before this PR:

julia> @btime M.add_bin_constraints(1_000_000)
267.887 ms (2000105 allocations: 809.08 MiB)

After this PR:

julia> @btime M.add_bin_constraints(1_000_000)
80.247 ms (105 allocations: 68.14 MiB)

Closes #566

@@ -270,10 +270,11 @@ function MOI.add_constraint(model::AbstractModel, f::F, s::S) where {F<:MOI.Abst
if MOI.supports_constraint(model, F, S)
# We give the index value `nextconstraintid + 1` to the new constraint.
# As the same counter is used for all pairs of F-in-S constraints,
# the index value is unique across all constraint types as mentionned in `@model`'s doc.
# the index value is unique across all constraint types as mentionned in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: mentioned

@codecov-io
Copy link

Codecov Report

Merging #567 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
+ Coverage   95.67%   95.67%   +<.01%     
==========================================
  Files          47       47              
  Lines        4830     4834       +4     
==========================================
+ Hits         4621     4625       +4     
  Misses        209      209
Impacted Files Coverage Δ
src/Utilities/model.jl 100% <100%> (ø) ⬆️
src/functions.jl 100% <100%> (ø) ⬆️
src/sets.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdb7ec9...fa529fc. Read the comment docs.

@blegat blegat merged commit cfce251 into master Nov 12, 2018
@mlubin mlubin deleted the bl/add_con_deepcopy branch November 12, 2018 16:07
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.

3 participants