OData / OData/AspNetCoreOData

Performance concern on ODataOutputFormatter

Open
#959 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected
ASP.NET Core OData 8.0.12

Description
Hi, we have noticed a high latency (200ms - 400ms) spent in ODataOutputFormatter that serializes and writes to response body after the results (around 350 KB) have been returned from the controller.

Our schema is similar like this

[
  {
    "id": "string",
    "rating": {
      "id": "string",
      "count": 0,
      "average": 0,
      "breakdown": {
        "oneStar": 0,
        "twoStars": 0,
        "threeStars": 0,
        "fourStars": 0,
        "fiveStars": 0
      }
    },
    "scores": [
      {
        "type": "string",
        "value": 0
      },
      {
        "type": "string",
        "value": 0
      }
    ]
  }
  ...
]

Here is the obtained profiler
Screenshot 2023-06-15 170913

Could you please help us understand what we could do to improve?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ODataOutputFormatter and the attached profiler, then reproduce serialization of the approximately 350 KB nested response schema described in the issue. Compare the formatter's latency with the controller result generation and identify a measured, actionable cause or improvement for the reported 200–400 ms delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.