Files
mpv/common
Avi Halachmi (:avih) 1c3eecd821 common/stats: improve accuracy of quick timed measurements
Previously stats_time_start first sampled cpu-time and then real-time,
while stats_time_end sampled them in reverse order.

This resulted in real-time delta values being possibly a bit smaller
than the respective cpu-time deltas, which could become meaningful if
the start/end durations are consistently very short and very frequent.

In one test case (measuging the time spent at the event loop of
a script which spins on zero timeouts), this resulted in accumulated
real-time value of ~230ms per second, with a respective cpu-time
values of ~500ms. This should not be possible with single thread load.

Now start and end sample the values at the same order, so that it
balances on average. Each start/end delta now includes overhead of one
of each sample type, and excludes one of each sample type on average.

With the test case above, it's now 490 +-1 ms for both.
(the other 510ms real-time are at the excluded mpv_wait_event calls
and the unmeasured-overhead-parts of stats_time_start/end).
2025-02-17 22:50:03 +01:00
..
2018-02-01 10:21:55 +01:00
2018-02-01 10:21:55 +01:00
2025-01-03 01:21:15 +01:00