Skip to content

Add typed projection fast paths - #90

Merged
leileizhang (lei9444) merged 1 commit into
mainfrom
perf/projection-fast-paths
Aug 10, 2026
Merged

leileizhang (lei9444) merged 1 commit into
mainfrom
perf/projection-fast-paths

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Summary

  • Add ABI-validated typed MethodHandle getters for HSTRING, Boolean, Int32/enum, and object values.
  • Add typed setters for HSTRING, Boolean, Int32, UInt32, Float32, and Float64 values.
  • Expose the fast paths through the JavaScript binding and feature-detect them in generated projections.
  • Fall back to the existing generic invoke() path when using an older runtime.
  • Cache generated activation, factory, and static interface factories instead of resolving them for every call.

Details

The native fast paths validate the method signature, parameter direction, HRESULT convention, and exact ABI type before calling the vtable. WinRT Boolean uses its u8 ABI representation, and failure paths release HSTRING/object outputs correctly.

Generated code only uses a fast method when it is available, preserving compatibility with existing runtime packages.

Testing

  • cargo test -p dynwinrt-codegen
  • cargo test -p dynwinrt
  • JavaScript binding cargo check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 84688dea-d965-4933-a2d9-41f8f6ad2f2e
@lei9444
leileizhang (lei9444) merged commit 4187d83 into main Aug 10, 2026
25 checks passed
@lei9444
leileizhang (lei9444) deleted the perf/projection-fast-paths branch August 10, 2026 09:38
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