Skip to content

Conversation

@lindexi
Copy link
Member

@lindexi lindexi commented Jan 20, 2021

No description provided.

@lindexi lindexi requested a review from a team as a code owner January 20, 2021 01:38
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jan 20, 2021
@ghost ghost requested review from SamBent, fabiant3 and ryalanms January 20, 2021 01:38
Base automatically changed from master to main March 17, 2021 17:38
@pchaurasia14
Copy link
Contributor

@lindexi - Do you have any benchmarks reports associated with this PR?

@lindexi
Copy link
Member Author

lindexi commented Jun 14, 2022

@pchaurasia14 It just remote a static field. And I think it hard to write the benchmarks code.

@h3xds1nz
Copy link
Member

@lindexi @pchaurasia14 The original code could be "faster" thanks to code-locality, the PR however saves few bytes in the class. If code-locality doesn't play a factor, both shall be equal in terms of performance.

In my opinion the perfect answer doesn't exist, code-gen itself is gonna be identical, Array.Empty<object>() returns a singleton, the code explosion already happened for object in some runtime lib, and in my opinion @lindexi's PR improves the code quality.

It is basically always going to boil down to this for a method that takes an arr as a param (obviously in case of the particular method in question, that would be already r9 register on x86_64)

mov rdx, 0x17664001eb8 ;immediate singleton ptr
mov rdx, [rdx] ;pass empty array ptr to func
call 0x00007ffbc4e90030 ;the function call
[MethodImpl(MethodImplOptions.NoInlining)]
private object[] EmptyMethod(object[] array)
{
    return suggestions;
}

@dipeshmsft dipeshmsft merged commit 9d14a29 into dotnet:main Dec 18, 2024
@dipeshmsft
Copy link
Member

Thank you @lindexi

@lindexi lindexi deleted the t/lindexi/XamlTypeInvoker branch December 18, 2024 06:43
h3xds1nz added a commit to h3xds1nz/wpf that referenced this pull request Jan 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants