-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Avoid string allocation and improve performance of JsonProperty.WriteTo
#90074
Commits on Aug 5, 2023
-
Avoid string allocation in WriteTo when possible.
System.Text.Json.JsonProperty.WriteTo uses get_Name, calling JsonElement.GetPropertyName() which would allocate a string. Use ReadOnlySpan<byte> from the underlying UTF8 json, when possible, by adding helper methods into JsonDocument & JsonElement. Fix dotnet#88767
Configuration menu - View commit details
-
Copy full SHA for ad30f54 - Browse repository at this point
Copy the full SHA ad30f54View commit details -
Avoid alloc in unescaping & escaping.
Current code unescapes & escapes property names and uses ToArray. Avoid alloc by adding internal GetRaw/WriteRaw methods.
Configuration menu - View commit details
-
Copy full SHA for 41f5c37 - Browse repository at this point
Copy the full SHA 41f5c37View commit details
Commits on Aug 6, 2023
-
Fix bugs on escaped property names
Original code doesn't handle GetRaw/WriteRaw on escaped property names correctly.
Configuration menu - View commit details
-
Copy full SHA for d4d84b1 - Browse repository at this point
Copy the full SHA d4d84b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c368aa3 - Browse repository at this point
Copy the full SHA c368aa3View commit details -
Further avoid alloc by inlining GetUnescapedSpan
Allocations are further avoided when the property name is shorter than JsonConstants.StackallocByteThreshold, by inlining JsonReaderHelper.GetUnescapedSpan.
Configuration menu - View commit details
-
Copy full SHA for c5c5593 - Browse repository at this point
Copy the full SHA c5c5593View commit details
Commits on Aug 7, 2023
-
Move writing logic to JsonElement;
Shorten names of new methods; Add a test of writing out special names.
Configuration menu - View commit details
-
Copy full SHA for 1528bf3 - Browse repository at this point
Copy the full SHA 1528bf3View commit details
Commits on Aug 11, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5690487 - Browse repository at this point
Copy the full SHA 5690487View commit details -
Configuration menu - View commit details
-
Copy full SHA for b6c8606 - Browse repository at this point
Copy the full SHA b6c8606View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9644915 - Browse repository at this point
Copy the full SHA 9644915View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63da811 - Browse repository at this point
Copy the full SHA 63da811View commit details
Commits on Sep 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for df8e6fa - Browse repository at this point
Copy the full SHA df8e6faView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2fd37c - Browse repository at this point
Copy the full SHA d2fd37cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ecca233 - Browse repository at this point
Copy the full SHA ecca233View commit details