From 55f9ec3ab12232974c193ec038653de340365168 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sat, 4 Aug 2018 16:30:23 +1200 Subject: [PATCH] Add documentation about reusing contract resolvers (#1785) --- Doc/ContractResolver.aml | 3 ++ Doc/Performance.aml | 14 ++++++++ .../Documentation/PerformanceTests.cs | 36 +++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/Doc/ContractResolver.aml b/Doc/ContractResolver.aml index 39e9eb6e..9cf6ec69 100644 --- a/Doc/ContractResolver.aml +++ b/Doc/ContractResolver.aml @@ -14,6 +14,9 @@ Anything that can be set on an object, collection, property, etc, using attributes or methods to control serialization can also be set using an IContractResolver. + + For performance you should create a contract resolver once and reuse instances when possible. Resolving contracts is slow and implementations of T:Newtonsoft.Json.Serialization.IContractResolver typically cache contracts. +