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

refactor!: move AMVF and IVF config explicitly #2509

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

felix-russo
Copy link
Contributor

Title says it all!

Might be breaking as now config must be moved in the parent scope.

It might be better to not move the config and pass it as a const reference, not sure though.

@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Vertexing labels Oct 4, 2023
@paulgessinger
Copy link
Member

I don't think it has performance implications. The move most likely is going to result in a regular copy anyway, but the compiler might end up optimizing this out the same way it does for the const ref. We also don't (or shouldn't) instantiate this very often (I think we do at this point, but only for convenience reasons) so I don't think it's a critical optimization.

@felix-russo
Copy link
Contributor Author

Should I just use a const ref then?

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #2509 (8edd312) into main (cc2f639) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2509   +/-   ##
=======================================
  Coverage   49.59%   49.59%           
=======================================
  Files         473      473           
  Lines       26824    26824           
  Branches    12355    12355           
=======================================
  Hits        13304    13304           
  Misses       4753     4753           
  Partials     8767     8767           
Files Coverage Δ
...clude/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp 89.47% <100.00%> (ø)
...clude/Acts/Vertexing/AdaptiveMultiVertexFitter.hpp 73.07% <100.00%> (ø)
...e/include/Acts/Vertexing/IterativeVertexFinder.hpp 80.00% <100.00%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@felix-russo felix-russo marked this pull request as ready for review October 4, 2023 16:14
@paulgessinger paulgessinger added this to the next milestone Oct 23, 2023
@acts-project-service
Copy link
Collaborator

acts-project-service commented Nov 6, 2023

🔴 Athena integration test results [178a798]

Build job with this PR failed!

Please investigate the build job for the pipeline!

@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Nov 6, 2023
Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

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

Anyway, implicitly moving mutable references is not a good idea anyway, so let's do this.

@paulgessinger paulgessinger changed the title refactor!: move AMVF and IVF config explicitely refactor!: move AMVF and IVF config explicitly Nov 6, 2023
@kodiakhq kodiakhq bot merged commit 178a798 into acts-project:main Nov 6, 2023
@github-actions github-actions bot removed the automerge label Nov 6, 2023
@paulgessinger
Copy link
Member

This required minor compile fixes in Athena.

@felix-russo felix-russo deleted the move-cfg-explicitely branch November 6, 2023 18:19
@paulgessinger paulgessinger modified the milestones: next, v31.0.0 Nov 7, 2023
@felix-russo
Copy link
Contributor Author

felix-russo commented Nov 10, 2023

I realized that we pass config structs almost always as const ref.

Should we do this here too? Or should we also use std::move for the other configs? @paulgessinger

@paulgessinger
Copy link
Member

@felix-russo It doesn't really matter. If you pass a const ref and copy into the member in the constructor or you pass a copy and move it into the container. The const ref might be slightly more efficient, because the move for a POD is effectively a copy.

But for config structs this should not be a concern.

BUT: we should never pass a mutable ref and move that, because it moves from the source value that the caller holds, which is super unexpected.

@paulgessinger paulgessinger removed the Breaks Athena build This PR breaks the Athena build label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Component - Examples Affects the Examples module Vertexing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants