You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PerformanceTests] Add timing for virtual vs. nonvirtual invocation.
This is why we want JniPeerMembers in Xamarin.Android: CACHEING!
## MethodInvocationTiming Timing: 00:00:03.6698748
Method Lookup + Invoke Timing:
Traditional: 00:00:00.0018948
No caching: 00:00:00.0255321
Dict w/ lock: 00:00:00.0018600
ConcurrentDict: 00:00:00.0032975
JniPeerMembers: 00:00:00.0022527
(I)I virtual+traditional: 00:00:00.0000809
(I)I virtual+JniPeerMembers: 00:00:00.0000873
(I)I nonvirtual+traditional: 00:00:00.0069499
(I)I nonvirtual+JniPeerMembers: 00:00:00.0001617
Xamarin.Android is close (-ish) to the `(I)I nonvirtual+traditional`
timing -- 0.0069s vs. 0.00008s for virtual dispatch (virtual dispatch
is ~86x faster! Though the bug [0] says ~4x on Android...?).
That's what we want to improve.
How's Java.Interop+JniPeerMembers do?
Virtual dispatch is 0.0000873s (slightly slower than
Xamarin.Android-style virtual dispatch [1]), but *nonvirtual* dispatch
is only 0.001617s, or 1.8x longer.
Still not entirely great -- we need to test this scenario on Android
-- but still nearly 2 orders of magnitude faster for nonvirtual
dispatch, which is a fairly common scenario.
[0]: https://bugzilla.xamarin.com/show_bug.cgi?id=32126
[1]: :-(
0 commit comments