The following code is slow because it generates dynamic serialization classes on every run:
var formatter = new JsonMediaTypeFormatter();
... // configure formatter
MyDocument value = new MyDocument();
HttpContent content = new ObjectContent<MyDocument>( value, formatter );
await httpClient.PutAsync( url, content );
Ideally I should cache the formatter value, however I'm using threads and the documentation says that instance members are not thread safe. This sounds like a design flaw or imprecise documentation, as the media type formatters can be used as ASP.NET content parsers (which are obviously thread-aware). Still it doesn't preclude the possibility that ASP.NET is using locks to avoid concurrent access.
Do you know any good source or indication that the JsonMediaTypeFormatter is actually thread-safe?