Remove std::ref call in for_each_args#279
Open
wthrowe wants to merge 1 commit intoedouarda:masterfrom
Open
Conversation
This call is hugely expensive to compile for some reason, and I don't think it does anything useful. Also mark the function as constexpr since that is now possible. Also fix embed.py errors with newer python, and build system errors with newer cmake..
Contributor
Author
|
Force pushed to also update to a supported version of cmake. |
Collaborator
|
This looks good to me. Gonna have a deep think about this std ref but I think the changeset is OK. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This call is hugely expensive to compile for some reason, and I don't think it does anything useful. Also mark the function as constexpr since that is now possible.
Also fix embed.py errors with newer python.
To be specific on the "hugely expensive" claim, here are the file sizes in bytes of the main object file for SpECTRE's
EvolveGhBinaryBlackHoleexecutable before and after this change:So, except for the GCC optimizer, which is apparently really good at eliding this sort of thing and reducing file size in general, this
std::refcall is responsible for over 200MB in each of our builds in this single object file. Removing it also reduced compile times by a minute or so for each of these on my desktop.I don't know why the
std::refwas there. As far as I can see, calling the functor through a reference_wrapper should have the same behavior as calling it directly, but if I'm missing something we can hopefully find a cheaper way of solving the problem.