* disable current benchmarks * temporarily expose Streaming constructor * hide Streaming constructor from docs * remove crossbeam-queue from deny skip list * add decode benches * fmt * use Bytes as MockDecoder Item
Criterion benchmarks for Tonic
Running the benchmarks
From the root Tonic directory, cargo bench
After running, the reports can be found in tonic/target/criterion/report/index.html
Gnuplot is required for graph generation. If gnuplot is not installed, Criterion will display: Gnuplot not found, disabling plotting at the console.
Notes
- Currently, these benchmarks only test the performance of constructing Tonic Requests and Responses, not over-the-wire throughput.
- The
thrptvalue generated by Criterion is simply a measure of bytes consumed by the target function. - As we are not testing tonic-build compile time, the tests reference pre-compiled .rs files in 'benchmarks/compiled_protos'.
- The original proto files are in the
protodirectory for reference. - This used the Criterion 3.0
Criterion Groupfunctionality. Details here: https://docs.rs/criterion/0.3.0/criterion/
Interpreting Results
Criterion is particularly useful for establishing a first-run baseline and then comparing after code-changes - e.g. Performance has regressed below.
Request_Response/request/100000
time: [2.7231 us 2.7588 us 2.7969 us]
thrpt: [33.298 GiB/s 33.758 GiB/s 34.200 GiB/s]
change:
time: [+16.073% +17.871% +19.980%] (p = 0.00 < 0.05)
thrpt: [-16.653% -15.162% -13.847%]
Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe