edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Phase timers for the decoder, enabled by `EC_VP9_PROFILE=1`. |
| 2 | //! |
| 3 | //! Each phase accumulates CPU nanoseconds across all threads (atomic adds), so with |
| 4 | //! tile threads the sums can exceed wall time. Off by default: `start` is then one |
| 5 | //! relaxed atomic load and no clock read. |
| 6 | |
| 7 | use ; |
| 8 | use Instant; |
| 9 | |
| 10 | /// Phases, indexes into [`TOTALS`]. |
| 11 | |
| 12 | pub |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | /// Names for [`report`], in [`Phase`] order. |
| 28 | pub const NAMES: = ; |
| 29 | |
| 30 | static TOTALS: = ; |
| 31 | |
| 32 | /// Whether `EC_VP9_PROFILE` turned the timers on (read once per process). |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | /// Start a timer; `None` when profiling is off. |
| 46 | pub |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | /// Add the time since `t` to `phase`. |
| 55 | pub |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | /// Accumulated seconds per phase, in [`NAMES`] order. |
| 62 | |
| 63 | |
| 64 |