-
Notifications
You must be signed in to change notification settings - Fork 37
Switch to using System.Text.Json instead of Newtonsoft to improve performance. #778
Conversation
src/Diagnostics.RuntimeHost/Services/CacheService/DiagEntityTableCacheService.cs
Show resolved
Hide resolved
@puneetg1983 , does the Response JSON change in anyway so as to require a change in swagger? |
I tested only the listdetectors and invoke detector call and ensured that they are exactly the same. But we have lot of other WEBAPI too and I dont know the best way to test all of them :( |
Hey @puneetg1983 , do we believe anything else to be different if ListDetectors and ExecuteDetector calls are fine? |
Hey @hforeste , I do see a bunch of other controllers and we should validate once that they are working as expected. For e.g. I saw yesterday that the Observer controller is failing and thats because it was returning a JArray and that is expected to fail. I quickly glanced at other controllers and they dont seem to be using classes from NewtwonSoft but its better if we can check them all one. |
Hey @puneetg1983 , added PR to remove the obsolete ObserverController. https://github.com/Azure/Azure-AppServices-Diagnostics/pull/780/files |
With this PR, we are changing the default formatted for the RuntimeHost project from NewtonSoft to System.Text.Json (STJ). Few changes were done in the code because System.Text.Json had some limitations or is a bit stricter than NewtonSoft. They are:-
KeyValuePair
serialization doesn't follow camel case option inSystem.Text.Json
dotnet/runtime#44385 and we had to update STJ to 6.0 to fix it.This is still a risky PR because I cannot test all API combinations locally. I plan to test this out in staging environment once the PR is merged and if things don't look fine, I will revert the PR.