Skip to content

Performance optimization when using GenericClient #1371

@prochnowc

Description

@prochnowc

Describe the bug

The GenericClient serializes reponse body's (which is already parsed JsonElement) to string and then parses them again via KubernetesJson.Deserialize<>.

Adding a new overload to KubernetesJson.Deserialize<> which accepts JsonElement and replacing the response.Body.ToString() calls with (JsonElement)response.Body would eliminate the need to deserialize the body twice.

Kubernetes C# SDK Client Version
11.0.21

Server Kubernetes Version
1.25.9

Dotnet Runtime Version
net6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions