JSON-RPC.NET icon indicating copy to clipboard operation
JSON-RPC.NET copied to clipboard

Add support for System.Text.Json

Open Astn opened this issue 5 years ago • 2 comments

Why?

  • Performance
  • System.Net.Json is a built in

See docs https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to

Astn avatar May 01 '20 02:05 Astn

I've pushed a branch up that starts work on this. Feel free to collaborate on it with me. branch: https://github.com/Astn/JSON-RPC.NET/tree/SwitchToSystem.Text.Json

Astn avatar Jan 22 '21 19:01 Astn

Initial tests show this branch is almost 2x as fast the current approach.

Starting benchmark
processed 50 rpc in      0ms for         ∞ rpc/sec
processed 100 rpc in     0ms for         ∞ rpc/sec
processed 300 rpc in     0ms for         ∞ rpc/sec
processed 1,200 rpc in   3ms for         400,000.00 rpc/sec
processed 6,000 rpc in   11ms for        545,454.55 rpc/sec
processed 36,000 rpc in          83ms for        433,734.94 rpc/sec
processed 252,000 rpc in         686ms for       367,346.94 rpc/sec
Finished benchmark...

Astn avatar Sep 10 '21 22:09 Astn