dotnet / dotnet/aspnetcore

NewtonsoftJsonOutputFormatter buffering improvements

Open
#21,245 8 comments 2 reactions 1 assignee Claimed by @davidfowl View on GitHub
affected-medium area-mvc enhancement feature-mvc-formatting Perf severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

Mvc's Newtonsoft.Json based serializer buffers contents to disk to avoid sync writes to the response stream. This was introduced in 3.0. We've received a few reports of people running in to issues with this. This issue tracks improvements to the buffering scheme:

* [x] Allow configuring the size of the in-memory buffer
* [x] Add benchmarks - https://github.com/aspnet/Benchmarks/issues/1498
* [ ] Optimize `PagedByteBuffer` so we page larger buffers (it's currently 1k)
* [ ] Optimize `PagedByteBuffer` so writing to disk is more efficient.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.