Closed jmbryan4 closed 1 year ago
use the ArgumentNullException.ThrowIfNull throw helper where possible to improve performance. Available with .NET 6
ArgumentNullException.ThrowIfNull
see: https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/#exceptions source: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs#L67-L69
https://andrewlock.net/exploring-dotnet-6-part-11-callerargumentexpression-and-throw-helpers/#throw-helpers-in-c-
https://github.com/search?q=repo%3AHavunen%2FSystemTextJsonPatch%20throw%20new%20Argument&type=code
Hi, thanks for sharing. We should implement this IMO 👍
This is now implemented in master branch and will be available in the next release. The change improved overall performance about 5%.
use the
ArgumentNullException.ThrowIfNull
throw helper where possible to improve performance. Available with .NET 6see: https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/#exceptions source: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs#L67-L69
https://andrewlock.net/exploring-dotnet-6-part-11-callerargumentexpression-and-throw-helpers/#throw-helpers-in-c-
https://github.com/search?q=repo%3AHavunen%2FSystemTextJsonPatch%20throw%20new%20Argument&type=code