Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.77 KB

using-utf8jsonwriter.md

File metadata and controls

22 lines (16 loc) · 1.77 KB
title description date ms.date author ms.author
Use Utf8JsonWriter
A guide on how to improve performance using Utf8JsonWriter.
2024-01-23
1/23/2024
habbes
clhabins

Use Utf8JsonWriter

Applies To:[!INCLUDEappliesto-webapi][!INCLUDEappliesto-webapi][!INCLUDEappliesto-odatalib]

The OData core library implements a wrapper on top of the Utf8JsonWriter to complement the default JSON writer. This writer offers better performance and fewer memory allocations compared to using the JSON writer that's used by default in Microsoft.OData.Core.

To enable Utf8JsonWriter, check out any of the following guides depending on the library you are using in your application:

When using Utf8JsonWriter, consider using the UnsafeRelaxedJsonEscaping encoder to perform escaping as described here. This encoder is more relaxed and escapes fewer characters. This can improve performance over the default encoder which escapes more characters. Frequent escaping of large strings may result in additional performance and memory overhead.