Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unnecessary range copy in vrptw::PDShift #852

Closed
jcoupey opened this issue Dec 14, 2022 · 0 comments · Fixed by #968
Closed

Unnecessary range copy in vrptw::PDShift #852

jcoupey opened this issue Dec 14, 2022 · 0 comments · Fixed by #968

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Dec 14, 2022

We're making a copy of the "remaining" source range in the vrptw::PDShift operator ctor:

_source_without_pd(s_route.begin() + _s_p_rank + 1,
s_route.begin() + _s_d_rank),

This means a lot of overhead for a downstream use where we only use iterators in validity checks. The tricky part is that the copy is indeed necessary inapply since we can't replace part of a route while iterating over a subset of the same route. But we could make it so that the copy only happens in apply which is only called a marginal number of times across all instances of the operator.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant