Repository navigation
Conversation
…gnatures Static and instance methods whose in-params are Int32, UInt32, Single, Double, Boolean, String or a runtime class or interface, and whose result is void, a boolean or a number, get a fast API overload built from metadata. Optimized callers skip the generic argument marshalling: strings pass as fast-pass references, objects are queried through the wrapper's interface cache, and the call goes through the register trampolines Win32 binds already use. Other methods, and calls with a different argument count, take the existing callback.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Stacked on #62.
WinRT methods with simple signatures get a V8 fast API overload, as bound Win32 functions already do (
win32_fast.rs).Which methods
PointerPlan::Interface).IReference, collections, out-params and other results. The plan is decided from metadata when the function template is built (winrt_fast::plan) and kept in the method'sDeclarationFFI.The fast call
receiver_method_call, so it goes through the wrapper's QI cache exactly as the slow callback does. For a static, it's the call prepared once on the class factory.call_registerswith[interface, args..., &result]. A failed HRESULT throws.Performance
x64 Release, measured in an app calling WinRT methods in a loop, best of 9 rounds. Both changes together against the base before #62:
Correctness was checked in the same loops: 20,000 valid and 20,000 invalid calls return
trueandfalseas the slow path does, and the callee's writes land.Tests
cargo test -p runtime --libgives the same result asmain: 195 passed, and the same 15 failures, which need COM activation, HTTP or a UI dispatcher in that environment. Those tests run unoptimized code, so the fast overloads are covered by the loop checks above.