-
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
Take this
explicitly to avoid argument shuffling by caller
#111084
Conversation
I don't think this is the right thing to do. It's just saving one Moreover, emitting static local function as static is quite an implementation detail of C# compiler. |
@MihuBot arm64 |
True, but it does impact code size.
Presumably relying on an implementation detail is acceptable in |
Wouldn't this also make things worse after inlining if |
There are only several bytes of difference with no real impact. In practice, we would take the opposite approach that accepts trivial regression to simplify the code. |
This pattern appears elsewhere: runtime/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultHtmlEncoder.cs Lines 98 to 100 in 0f6c3d8
|
@MihuBot -arm |
The trick in referenced code is outdated: sharplab It saves literally one |
|
@MihaZupan Interesting there is an improvement of 764 bytes on arm64, only 16 bytes on X64 |
@huoyaoyuan I see regressions in code size and PerfScore with the trick removed |
The "regression" is very unlikely to be impactful. PerfScore is an internal JIT term for optimization decisions. We shouldn't tweak code too much to fit the JIT, but teach JIT instead. |
This is not an exception throwing path. The trick is potentially saving extra instructions on a hot path here. It is still debatable whether this micro-optimization is worth the extra complexity. |
This improvement does not look real. It is an issue in asm-diff tooling. |
Thank you for a contribution, but we are not interested in complicating the code like this to save a few instructions on exception throwing paths. |
No description provided.