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.
Avoid generating duplicated code for trivially-copyable, -relocatable, -destructible pointer types. Although link-time optimizations may help, it is always more efficient to avoid duplication from the front-end.
Before (link):
After (link)
We can also observe significant performance boost at link-time. I tried to compile the following code on my dev machine with MSVC (with linker option
/OPT:ICF
to avoid generating duplicated code):Before this change, compiling it took 6.0 seconds; linking it took with an empty implementation of
DoSomethingWithAny()
took 7.3 seconds. After this change, compiling it took almost the same time, but linking it with the same implementation ofDoSomethingWithAny()
only took 1.7 seconds.Closes #82