Currently the custom type visitor just deserializes field names as strings, which allocates a new System.String for each field. However, the API supports passing through a ReadOnlySpan for UTF8 strings. This change should provide support using the ROS in the normal path and avoid allocation.
Currently the custom type visitor just deserializes field names as strings, which allocates a new System.String for each field. However, the API supports passing through a ReadOnlySpan for UTF8 strings. This change should provide support using the ROS in the normal path and avoid allocation.
Before:
After: