Increase foldability of various templates#1338
Increase foldability of various templates#1338jonwis merged 16 commits intomicrosoft:mastermicrosoft/cppwinrt:masterfrom jonwis:user/jonwis/template-foldjonwis/cppwinrt:user/jonwis/template-foldCopy head branch name to clipboard
Conversation
|
For posterity, switching One area of interest is in |
|
It looks like I can get another 8kb by regularizing the tail of It also looks like the cluster around |
|
/azp run |
|
No pipelines are associated with this pull request. |
|
Overall looks like goodness. Just a few comments. |
For windows-rs I managed to write a "constexpr" version of |
|
Making the constructor of |
I was referring to return values, which has a lot more optimizing value. |
…/cppwinrt into user/jonwis/template-fold
#1338 changed the NuGet version to a property, but didn't update the build.yml to do the same thing
#1338 changed the NuGet version to a property, but didn't update the build.yml to do the same thing
SizeBench revealed heavily non-foldability of certain C++/WinRT templates contributing to increased Windows binary sizes. Some small tweaks dropped the size of
test.exe(release, x64) by ~132kb. (5180416 -> 5030400, or 2.8% ... which isn't a super lot, but it's nonzero.Fixes #1334 and related
Changes
Enable nuspec iteration - Bump the default nuspec version to 3.0.0.0 so
build_nuget.cmdand iterating with a local nuget source is easier.Add solution files - Niceness for people who live in Visual Studio.
Fold delegate bases - Forced the layout of the delegate types to be regular by moving the reference count into a base before the non-ABI types. This folds nearly all the AddRef/QueryInterface instances into one. Releases are still unique because they call up into dtors.
Fold "report" in invoke - The invoke helper is a try/catch{report} but the body of "report" is identical on each invoke specialization. Move it to a unique non-inlineable method.
Fold event::add - Make the delegate first, then all the "expand the collection" instances are identical.
Further Work
SizeBench reports the following additional foldability wastage, quoted from the same test.exe:
::Invokevtable and offset adjusters.make_agile_delegatehstringconstruction.Testing
Tested by
build_and_test.cmd- all built, all passed