Skip to content

Significant Performance difference between Kiota-based client vs using HttpClient directly #632

@hlavingia

Description

@hlavingia

We've observed a noticeable performance difference between using the Kiota-based C# client and making direct HttpClient calls with manual deserialization via System.Text.Json. Is there a way to optimize Kiota client function calls to bring performance comparable to using HttpClient directly? Here, based on our performance tests, HttpClient is performing 2X faster than consuming kiota client auto generated for the service.

Following versions are consumed for Kiota client.

dotnet tool: microsoft.openapi.kiota: 1.27.0

To generate Kiota client
PackageVersion Include="Microsoft.Kiota.Abstractions" Version="1.19.0"
PackageVersion Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.19.0"
PackageVersion Include="Microsoft.Kiota.Serialization.Json" Version="1.19.0"

For Kiota client project
PackageVersion Include="Microsoft.Kiota.Serialization.Form" Version="1.19.0"
PackageVersion Include="Microsoft.Kiota.Serialization.Multipart" Version="1.19.0"
PackageVersion Include="Microsoft.Kiota.Serialization.Text" Version="1.19.0"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions