Skip to content

Add server begin to client decode time benchmark

Lubosz Sarnecki requested to merge lubosz/electric-maple:benchmark into main

This patch set adds a benchmark that is evaluated on the client and measures the time it takes before the server compositor blits a frame until the client decodes it.

It takes the full pipeline into account, so it's influenced by the CPU read-back performance, the encoding performance, the network performance as well as the decoding performance.

The benchmark must be enabled on the server with the --benchmark-begin-to-decode-time parameter. The server then sends it's monotonic clock every second over the data channel. The client calculates the smallest offset to transform the timestamp from every DownMsg into it's time domain.

Since I wanted to take the server blit / readback time into consideration, the server timestamp is now measured at the compositor's begin time. Thus I have renamed the protobuf field from display_time to begin_time. The field was unused anyway until now and technically we were not displaying the frame on the server anyway.

To synchronize counters, the DownMsg frame id is now the same as in the compositor and does not iterate it's own. In addition I have removed the population of the xrt_frame with frame ids and timestamps, marked as "HACK", which were later used for the GStreamer appsrc times. The appsrc now measures it's own "now", which is essentially the same behavior as before but more explicit.

The benchmark can be collected via logcat and evaluated with a Python script:

adb logcat -c && adb logcat ElectricMaple *:S | grep "BENCHMARK" > measure_x264.log
./scripts/evaluate_benchmark_log.py measure_x264.log 

Merge request reports