Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove use of Tuple<> from corelib#44706

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jkotas merged 2 commits intodotnet:masterfromstephentoub:tupleslim
Nov 17, 2020
Merged

Conversation

@stephentoub
Copy link
Member

Related to#44684
cc:@jkotas,@marek-safar

(The flip side of this change, of course, is that ifTuple<T1, T2> is already being used by the rest of the app, this could actually increase the overall size rather than decrease it.)

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly onearea label.

@jkotas
Copy link
Member

jkotas commentedNov 15, 2020
edited
Loading

I think this is a good idea. If we take this route, we should also do a pass to remove uses of Tuple in netcoreapp that are easy to avoid. For example, the Tuple use insrc\libraries\System.Security.Cryptography.Algorithms\src\Internal\Cryptography\AesImplementation.Unix.cs can be replaced with ValueTuple or custom type.

@stephentoub
Copy link
MemberAuthor

we should also do a pass to remove uses of Tuple in netcoreapp that are easy to avoid

For uses that need to pass a few arguments through an object state, is there a measurable downside to boxing/unboxing aValueTuple<> instead of usingTuple<>?

jkotas reacted with thumbs up emoji

@jkotas
Copy link
Member

is there a measurable downside to boxing/unboxing

I doubt it that the difference is measurable. It is just an extra local copy (ie a few extra mov instructions).

@jkotas
Copy link
Member

There is a difference between TupleSlim vs. Tuple/ValueTuple for AOT. The full AOT compilers will typically end up generating the code for all interfaces and methods on Tuple/ValueTuple. TupleSlim avoids this overhead.

@stephentoub
Copy link
MemberAuthor

There is a difference between TupleSlim vs. Tuple/ValueTuple for AOT

Right.

for all interfaces and methods on Tuple/ValueTuple

Minus anything that could be trimmed, but presumably the problem here is little can be trimmed because most of the methods are interface implementations or virtual overrides.

It is just an extra local copy

And if it were an issue (which it shouldn't be), there's always Unsafe.Unbox I guess.

jkotas reacted with thumbs up emoji

@stephentoubstephentoub added the linkable-frameworkIssues associated with delivering a linker friendly framework labelNov 17, 2020
@stephentoubstephentoub added this to the6.0.0 milestoneNov 17, 2020
@jkotasjkotas merged commita5d6b30 intodotnet:masterNov 17, 2020
@stephentoubstephentoub deleted the tupleslim branchNovember 21, 2020 01:10
@ghostghost locked asresolvedand limited conversation to collaboratorsDec 21, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@marek-safarmarek-safarmarek-safar approved these changes

@jkotasjkotasjkotas approved these changes

Assignees

No one assigned

Labels

linkable-frameworkIssues associated with delivering a linker friendly framework

Projects

None yet

Milestone

6.0.0

Development

Successfully merging this pull request may close these issues.

4 participants

@stephentoub@Dotnet-GitSync-Bot@jkotas@marek-safar

[8]ページ先頭

©2009-2025 Movatter.jp