Skip to content

Performance improvement for MRW.Read #51341

@live1206

Description

@live1206

Right now, our SDK projects are targeting net8.0.
And when we start to target net10.0, which is the next LTS.

We can make performance improvements for MRW.Read as

#if NET9_0_OR_GREATER
    global::System.ClientModel.Primitives.ModelReaderWriter.Read<global::Azure.ResourceManager.Models.OperationStatusResult>(new global::System.BinaryData(global::System.Runtime.InteropServices.JsonMarshal.GetRawUtf8Value(item).ToArray()), options, AzureResourceManagerContext.Default)
#else
                ModelReaderWriter.Read<OperationStatusResult>(new BinaryData(Encoding.UTF8.GetBytes(item.GetRawText())), options, AzureResourceManagerContext.Default)
#endif

For now, we will just generate the else path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageCodeGenIssues that relate to code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions