You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for sharing this. I'm not sure it's as simple as it may look though. We modify the contracts that this DefaultContractResolver object returns in a way that varies based on the instance of the MarshalContractResolver (and in turn, based on the instance of the JsonMessageFormatter). If we were to share a common DefaultContractResolver, the cached contracts would be shared across these instances, and the mutation may corrupt contracts that were previously returned. Such a bug would likely only manifest when multiple threads are actively serializing/deserializing at once, so simple functional tests may not catch it.
JSON Contract resolver is being allocated over and over again, causing more allocation and CPU usage due to reflection and jitting.
For more information: check:
https://www.linkedin.com/feed/update/urn:li:activity:7096144517917016064/
https://frugalcafe.beehiiv.com/p/fc17-real-world-example-not-reusing-json-contract-resolver
The text was updated successfully, but these errors were encountered: