Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

# The measurement: ProcessAsync must scale from 1 to 4 workers. A process-wide serialization point holds the ratio
# near 1.3 on any core count. Diagnostic on the shared runner (its core count and isolation are not promised, so
# this job is not required and continues on error); the release gate is `--scale 3 16 4.0` on the reference machine.
# this job is not required and continues on error); the release gate is `--scale 3 32 4.0` in the cpu-performance publish job.
# The per-serializer diagnostics after the gate (one run per cell, never part of the exit code) go to their own summary section.
scaling:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions AustinHarris.JsonRpc.AspNetCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ invoked.
Replies already finished are flushed before the connection waits on a slow method. When the connection closes,
the handler waits for the running method to finish and discards its response.
- **Cost:** every document then goes through `ProcessAsync`. With methods that complete inline, the TCP row measured
15.0 M to 15.4 M against 14.3 M to 16.5 M for the synchronous mode on the same day, inside its spread. A method that
17 M to 17.1 M against 18.5 M for the synchronous mode in the same benchmark job, about 8 % lower by the medians. A method that
suspends pays for its own async state, the library's completion state and a continuation per request; the main README's
Async table measured 559 B per request for the yielding None row in process at one worker, including the service's own
Async table measured 548 B per request for the yielding None row in process at one worker, including the service's own
allocations. The main README's Kestrel table has both rows, measured with `TestServer_Console --kestrel 3 async`.

A method receives the token by declaring a `[JsonRpcCancellation] CancellationToken` parameter; see
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ behaviour: a breaking change to either means a new major version.
- Notifications never get a wire response, whatever their outcome.
- Dates and non-finite numbers are written the same way by every serializer (fraction only when non-zero, `Z`/offset/nothing by `Kind`; `NaN` and the infinities as quoted strings).
- Clarified that the WebAssembly sample is not a Native AOT or full-trimming compatibility guarantee.
- The published benchmarks are measured on a Hugging Face Jobs `cpu-performance` host (AMD EPYC 7R13, 32 cores) and regenerated from the job's data (`benchmarks/hf/`, `ingest.py`, `render.py`); the desktop figures are gone from the README except the browser table.

### Deprecated

Expand Down
18 changes: 11 additions & 7 deletions Json-Rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,26 @@ The synchronous entry points do not await those methods.

## Performance

These results compare 1.2.3 and 2.0 with the same five requests on the same machine in one session.
The 2.0 runs used the built-in serializer on an AMD Ryzen 7 7800X3D with .NET 10, Release and Server GC.
These results compare 1.2.3 and 2.0 with the same five requests on the same machine in one benchmark job.
The 2.0 runs used the built-in serializer on a Hugging Face Jobs `cpu-performance` host (AMD EPYC 7R13, 32 cores) with .NET 10, Release and Server GC.
Each range is the low and high over the job's runs; the ratios are of the medians.

![JSON-RPC.Net 1.2.3 and 2.0 throughput through the string and byte entry points](https://raw.githubusercontent.com/Astn/JSON-RPC.NET/master/benchmarks/charts/headline-1x-vs-2.svg)

<!-- benchmarks:headline -->
| Path | RPC/s | Against 1.2.3 |
| --- | ---: | ---: |
| 1.2.3, `Task<string> Process(string)`, thread pool, best batch size | 3.08 M | |
| 2.0, the same string API and the same loop | 13.3 M | 4.3× |
| 2.0, `Process(bytes)`, 16 dedicated threads | 31.7 M | 10.3× |
| 2.0, `ProcessAsync(bytes)`, 16 awaited workers | 32.1 M | 10.4× |
| 1.2.3, `Task<string> Process(string)`, thread pool, best batch size | 1.29 M to 2.41 M | |
| 2.0, the same string API and the same loop | 9.83 M to 11.1 M | 6.0× |
| 2.0, `Process(bytes)`, 32 dedicated threads | 44.2 M to 45.7 M | 24.3× |
| 2.0, `ProcessAsync(bytes)`, 32 awaited workers | 36.3 M to 40.5 M | 20.7× |

<!-- /benchmarks:headline -->

These measurements cover the library without a transport.
The asynchronous byte row uses methods that complete inline.
For Kestrel TCP with 256 requests in flight per connection and `EnableAsyncMethods = false`,
the measured range is 14.3 M to 16.5 M RPC/s on loopback, with clients and server on the same machine.
the measured figure is 18.5 M RPC/s on loopback, with clients and server on the same machine.

See the [benchmark tables](https://astn.github.io/JSON-RPC.NET/#benchmarks) for conditions
and the [benchmark explorer](https://astn.github.io/JSON-RPC.NET/benchmarks/charts/explorer.html) for the data.
Expand Down
Loading
Loading