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
{{ message }}
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
My 2 cents: these Task -returning methods have been removed for a reason: they were not really asynchronous and used Task.Factory.StartNew / Task.Run internally. Offloading pure CPU-bound operations to the thread pool is generally not a good idea and often incur a little overhead, and that's why this kind of practices should be limited to UI, where responsiveness is essential. Don't miss this topic if you want more information: JamesNK/Newtonsoft.Json#66
Even if these methods are only used in unit tests, I'd suggest removing Task.Factory.StartNew and making ReturnJsonResponse synchronous (or using Task.FromResult if you wanna keep it async) to reduce the cost of thread switching and limit its impact on the execution duration.
The text was updated successfully, but these errors were encountered:
Suggestion from @PinpointTownes regarding the change at 13adde6#commitcomment-7735513
My 2 cents: these Task -returning methods have been removed for a reason: they were not really asynchronous and used Task.Factory.StartNew / Task.Run internally. Offloading pure CPU-bound operations to the thread pool is generally not a good idea and often incur a little overhead, and that's why this kind of practices should be limited to UI, where responsiveness is essential. Don't miss this topic if you want more information: JamesNK/Newtonsoft.Json#66
Even if these methods are only used in unit tests, I'd suggest removing Task.Factory.StartNew and making ReturnJsonResponse synchronous (or using Task.FromResult if you wanna keep it async) to reduce the cost of thread switching and limit its impact on the execution duration.
The text was updated successfully, but these errors were encountered: