-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Helper Method Frames (HMF) from Reflection #110211
Conversation
Remove Delegate.IntenalAlloc and Delegate.InternalAllocLike.
Tagging subscribers to this area: @mangod9 |
This one looks related:
|
@jkotas @steveharter I'm not sure the Any concern with me changing the test? |
See fa675ce for update to the interpreter test. |
Upon further reflection it appears the JIT is now inlining function calls and the behavior matches Mono. Removed the special casing of Mono/CoreCLR and the tests all pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this noticeably affect performance?
No, go ahead and remove or modify that test. |
Failure seems to be #106094 |
src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs
Show resolved
Hide resolved
@EgorBot -windows_intel
|
I am seeing about 30% regression in a simple delegate combine microbenchmark locally. Let's see whether egorbot confirms it. Looks like I was wrong about AllocateNoChecks optimization usefulness. However, I still see about 15% regression even with the last commit deleted, so some of that regression comes from the generalization and passing extra args. I think the alloc helper needs some perf tweaks to avoid perf regressions in delegate operations. Alternatively, reverting the delegate changes and leaving the allocation helper unification as a problem for future would be fine with me too. |
Egorbot measured 1.26x slowdown: EgorBot/runtime-utils#198 (comment) |
@EgorBot -windows_intel
|
@jkotas Putting back in the no checks allocation function reduces the regression to noise (< 1 %) - EgorBot/runtime-utils#199 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Create general purpose RuntimeTypeHandle.InternalAlloc() and RuntimeTypeHandle.InternalAllocNoChecks(). Convert RuntimeMethodHandle::ReboxToNullable() to managed. Convert RuntimeMethodHandle::ReboxFromNullable() to managed. Convert RuntimeMethodHandle::InvokeMethod() to QCall.
Create general purpose RuntimeTypeHandle.InternalAlloc() and RuntimeTypeHandle.InternalAllocNoChecks(). Convert RuntimeMethodHandle::ReboxToNullable() to managed. Convert RuntimeMethodHandle::ReboxFromNullable() to managed. Convert RuntimeMethodHandle::InvokeMethod() to QCall.
Convert
RuntimeMethodHandle::ReboxToNullable()
to managed.Convert
RuntimeMethodHandle::ReboxFromNullable()
to managed.Convert
RuntimeMethodHandle::InvokeMethod()
to QCall.