Skip to content

Conversation

@GermanAizek
Copy link

@GermanAizek GermanAizek commented May 7, 2023

@variar,
I'm not sure of course, but maybe you're interested in rewriting some parameters of functions to create guaranteed C++17 metafunctions that are more optimized due to constant conditions and variables.
I doubt that the functions I fixed have a big impact on performance, but this is a step towards using such a method for functions that are frequently called.

More info here: https://stackoverflow.com/a/57211067
My tests on godbolt here: https://godbolt.org/z/4qq9n38Tz

@variar
Copy link
Owner

variar commented May 13, 2023

As far as I understand, this removes a branch from code path at the expense of compiling separate versions of the function for different conditions. The approach might be useful. However, I'd apply it only for hot-path and after doing some measurements that justify increase in complexity/compilation time.

@GermanAizek
Copy link
Author

@variar, should I run benchmark using std::chrono?

@GermanAizek
Copy link
Author

@variar, is this pull request still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants