-
Notifications
You must be signed in to change notification settings - Fork 157
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
feat: Define all surface methods out-of-line #676
feat: Define all surface methods out-of-line #676
Conversation
Codecov Report
@@ Coverage Diff @@
## master #676 +/- ##
==========================================
- Coverage 49.03% 49.02% -0.02%
==========================================
Files 331 325 -6
Lines 16549 16547 -2
Branches 7725 7727 +2
==========================================
- Hits 8115 8112 -3
+ Misses 3013 3012 -1
- Partials 5421 5423 +2
Continue to review full report at Codecov.
|
CI reports memory usage to be the same, but hints toward slightly lower time to compile. Not super conclusive though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no technical problems with this.
Personally, I would strongly prefer to not make this configurable and to move the inline code to regular .cpp
files instead. As suggested by the CI build and by @paulgessinger observations, moving the implementations to .cpp
files has no measurable performance impact in realistic setups. The proposed setup adds complexity that we need to maintain in the future. If there is a hotspot in one of the methods that can be improved by inlining, we can move that particular function as an inline function into the .hpp
file in the future.
@msmk0: I removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving code around, looks good.
Wanted to wait to see 'if' we see some change in |
As previously discussed, most Surface related methods are currently defined as
inline
in.ipp
files.This PR adds a cmake optionACTS_SURFACE_INLINE
. If enabled, the.hpp
files will not include their corresponding.ipp
files, but their corresponding.cpp
files will. Using a special preprocessor directive, theinline
keywords are removed from the methods, turning them into regular symbols.This PR moves all method definitions into the corresponding
.cpp
files.In local testing, I don't observe runtime performance degradation and slight compile-time improvement. Let's see what the CI has to say on the latter topic.
The use of preprocessor macros might be controversial, so let's discuss. The reason I think this approach might be a good idea is that this enables us to possible to back to the inlined methods. If we choose to go this route, we should probably ensure that both variants work in the CI.Fixes #409