Skip to content

Py/WinRT: Size Optimization#285

Merged
devhawk merged 8 commits into
masterfrom
devhawk/sizeopt
Apr 5, 2019
Merged

Py/WinRT: Size Optimization#285
devhawk merged 8 commits into
masterfrom
devhawk/sizeopt

Conversation

@devhawk

@devhawk devhawk commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

A set of changes to minimize the binary size of the python language projection.

  • switched back to inline try/catch blocks instead of using template trycatch_invoker
  • created a set of error handling functions (set_invalid_activation_error, set_invalid_arg_count_error, set_invalid_kwd_args_error) to reduce generated code size
  • optimized code generation for methods that don't have out parameters
  • add noexcept in lots of places

With this change, the compiled DLL size of the full WinRT Python projection (not including XAML or Composition as Python projection doesn't support runtime class inheritance yet) drops from 15.07mb to 12.99mb.

Code generation differences from master branch can be viewed in the devhawk/pywinrt-output repo: https://github.com/devhawk/pywinrt-output/compare/sizeopt

Comment thread src/tool/python/helpers.h Outdated
@devhawk devhawk merged commit dc8d353 into master Apr 5, 2019
@devhawk devhawk deleted the devhawk/sizeopt branch April 5, 2019 16:19
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.

3 participants