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

Improve perf of JsonValue.CreateFromElement by calling ValueKind once#104108

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

Conversation

@andrewjsaid
Copy link
Contributor

Following#104048 (comment)

JsonElement.ValueKind actually does quite a few operations as described below. This PR is a small change so that it's only called once.

publicJsonValueKindValueKind=> TokenType.ToValueKind();`
privateJsonTokenTypeTokenType=> _parent?.GetJsonTokenType(_idx)?? JsonTokenType.None
internalJsonTokenTypeGetJsonTokenType(intindex){CheckNotDisposed();return_parsedData.GetJsonTokenType(index);}
internalJsonTokenTypeGetJsonTokenType(intindex){AssertValidIndex(index);uintunion=MemoryMarshal.Read<uint>(_data.AsSpan(index+NumberOfRowsOffset));return(JsonTokenType)(union>>28);}

cc@eiriktsarpalis

eiriktsarpalis reacted with thumbs up emoji
@dotnet-policy-servicedotnet-policy-servicebot added the community-contributionIndicates that the PR has been added by a community member labelJun 27, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-json,@gregsdennis
See info inarea-owners.md if you want to be subscribed.

Copy link
Member

@eiriktsarpaliseiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks!

@eiriktsarpaliseiriktsarpalis merged commitdaadf8e intodotnet:mainJul 1, 2024
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 1, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@eiriktsarpaliseiriktsarpaliseiriktsarpalis approved these changes

Assignees

No one assigned

Labels

area-System.Text.Jsoncommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@andrewjsaid@eiriktsarpalis

[8]ページ先頭

©2009-2025 Movatter.jp