Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Consider using 65536 as streaming threshold for JsonConverter #5978

Copy link
Copy link

Description

@vonzshik
Issue body actions

Right now we're using 81920 bytes as a streaming threshold:

const int StreamingThreshold = 81920;

The problem with this is, we use ArrayPool<byte>.Shared to get temporary buffers, and in case we pass a length larger than 65536, it's going to allocate a 130kb buffer, which is much larger than LOH threshold. It's usually not that big of a deal since we're going to reuse these buffers anyway, but in case of memory pressure it's probably better if that array will be in Gen 2 rather than LOH.

cc @NinoFloris

Reactions are currently unavailable

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.