-
Notifications
You must be signed in to change notification settings - Fork 5.2k
STJ: set initial capacity of JsonObject if known (#96417) #96486
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
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue Detailsnull
|
src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.IDictionary.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs
Outdated
Show resolved
Hide resolved
also, caught one more spot to use the IsCaseInsensitive helper
src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs
Outdated
Show resolved
Hide resolved
|
@eiriktsarpalis thanks so much for your continued help with this PR. I am working on getting internal legal approval for the contributor license agreement. While we're on the subject, though, I wanted to bounce another idea off you to see if it would be worth investigation: It appears that Does that make sense to you? EDIT: Specifically, I'm thinking that we may modify the constructor here to skip creating the |
|
@dotnet-policy-service agree company="Olo, Inc." |
Possibly. You could try opening a new PR after this one is merged, although this one would probably need a bit of microbenchmarking to back its necessity. |
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.
This looks excellent, thank you 🎉
Awesome!! Thanks so much for your help on this, @eiriktsarpalis (and @to11mtm) |
…et#96486) * STJ: set initial capacity of JsonObject if known (dotnet#96417) * fix nullable type typo * just tweaking to run the gh actions again to confirm * wip/squash. use `TryGetNonEnumeratedCount`/polyfill * wip. go back to using just a check against ICollection * wip/squash. remove System.Linq dependency * wip. avoid adding a new field * wip/squash. move more of the logic into the ctor * wip/squash. use static private helper method * wip/squash. use null-coalescing operator also, caught one more spot to use the IsCaseInsensitive helper * wip/squash. use more syntax sugar! --------- Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Fix #96417.