You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of #2259, the KeyValuePair converter was identified as an area of potential perf improvement. Currently (and in 3.0\3.1) it re-enters the serializer to serialize TKey and TValue which is expensive because a Dictionary lookup occurs for each (to find the converter).
Instead, the converter should cache the converter. Caching is possible on the converter instance since the type is internal and there are no concerns about having an instance shared across different JsonSerializerOptions instances that may have different converters for TKey and TValue.
The text was updated successfully, but these errors were encountered:
As part of #2259, the KeyValuePair converter was identified as an area of potential perf improvement. Currently (and in 3.0\3.1) it re-enters the serializer to serialize
TKey
andTValue
which is expensive because a Dictionary lookup occurs for each (to find the converter).Instead, the converter should cache the converter. Caching is possible on the converter instance since the type is internal and there are no concerns about having an instance shared across different
JsonSerializerOptions
instances that may have different converters forTKey
andTValue
.The text was updated successfully, but these errors were encountered: