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
40 changes: 40 additions & 0 deletions docs/perf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Flat profile of the decoders (M0)

Where the time goes in go-avkit/vpx v0.1.0, single thread, on the reference host (`fractal`,
linux/amd64, `GOEXPERIMENT=simd`, load 1 to 2). `perf record -F 1999 -g`, then
`perf report --no-children --stdio --sort dso,sym -g none`; the raw reports are in `raw/`.

- [`port-vp9-1tile.md`](port-vp9-1tile.md): VP9, one tile, 7.34 ms per frame under perf.
- [`port-vp8.md`](port-vp8.md): VP8.

The tables are produced by `tools/perfgroups` (`perfgroups --report raw/port-vp9-1tile.txt
--title ...`): every function at or above 0.5 %, and the share of each stage. A function is put in
the stage its name says; the VP9 residue readers (`readVP9ResidueBlock`, `readVP9InterResiduePlane`)
parse tokens and also add the residue, and are counted under bool/tokens, so reconstruction add is
slightly understated and bool/tokens slightly overstated for VP9.

| stage | VP9 1 tile | VP8 |
|---|---|---|
| inter prediction | 45.9 % | 33.3 % |
| loop filter | 25.3 % | 34.3 % |
| modes/MV | 11.9 % | 6.4 % |
| bool/tokens | 9.1 % | 13.6 % |
| itx | 4.2 % | 2.6 % |
| copy/alloc | 1.7 % | 3.1 % |
| intra | 1.2 % | 3.1 % |
| reconstruction add | 0.2 % | 1.5 % |
| other | 0.4 % | 2.1 % |

Inter prediction and the loop filter are 71 % of VP9 and 68 % of VP8 time: the interpolation
kernels (`pixel.filterWide8`, `filterNarrow8`, `filterSixNarrow8`) and the loop-filter helpers are
where a gap with libvpx would have to be closed.

## What is not measured: the libvpx column

The design asks for the same table for libvpx, function by function. It could not be produced. The
libvpx 1.14.0 that ffmpeg loads (`libvpx.so.9.0.0`, build-id
`14344138b67ba2a321db9d7933fd5c4a171f8c77`) is stripped, so `perf` shows only addresses. Its debug
symbols come from `debuginfod.ubuntu.com`, whose 6.3 MB download was cut short on every attempt
(from two hosts), and the `ddebs.ubuntu.com` archive does not hold it. Building libvpx from source
with symbols was not done. The `perfgroups` tool reports such addresses under "unresolved" and
never places them in a stage, so a symbolized libvpx report can be fed to the same tool unchanged.
58 changes: 58 additions & 0 deletions docs/perf/port-vp8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
### VP8, go-avkit/vpx v0.1.0 (single thread)

| stage | share |
|---|---|
| bool/tokens | 13.6 % |
| modes/MV | 6.4 % |
| inter prediction | 33.3 % |
| intra | 3.1 % |
| itx | 2.6 % |
| reconstruction add | 1.5 % |
| loop filter | 34.3 % |
| copy/alloc | 3.1 % |
| other | 2.1 % |
| unresolved | 0.1 % |
| total listed | 100.0 % |

Functions at or above 0.5 %:

| share | stage | function |
|---|---|---|
| 14.67 % | inter prediction | `pixel.filterSixNarrow8` |
| 7.54 % | loop filter | `pixel.loopFilterMacroInternalFusedVertical` |
| 6.59 % | bool/tokens | `vp8/boolcoder.(*Decoder).ReadVP8MacroblockCoeffs` |
| 5.41 % | inter prediction | `pixel.filterVerticalSix8` |
| 4.77 % | bool/tokens | `vp8/boolcoder.decodeVP8NonZeroBlockFast` |
| 4.21 % | loop filter | `pixel.loadLFColumnTile[go.shape.[8]uint8]` |
| 3.54 % | modes/MV | `vp8/decoder.FindNearMotionVectors` |
| 3.40 % | loop filter | `pixel.loadLFUVColumns` |
| 3.16 % | loop filter | `pixel.loopFilterUVBytes` |
| 2.78 % | inter prediction | `vp8/dsp.sixTapPredictGo` |
| 2.44 % | loop filter | `vp8/decoder.applyNormalLoopFilterMB` |
| 2.26 % | inter prediction | `pixel.Filter` |
| 2.09 % | loop filter | `pixel.loopFilterMacroInternalFusedHorizontal` |
| 2.00 % | loop filter | `pixel.storeLFByteTileRows[go.shape.[6]uint8]` |
| 1.86 % | loop filter | `pixel.transposeBytes8` |
| 1.56 % | modes/MV | `vp8/boolcoder.(*Decoder).ReadVP8MVComponent` |
| 1.52 % | copy/alloc | `runtime.memmove` |
| 1.48 % | inter prediction | `vp8/decoder.reconstructInterFrameGridRow` |
| 1.46 % | inter prediction | `pixel.filterFourNarrow8` |
| 1.38 % | inter prediction | `vp8/decoder.reconstructWholeMVInterMacroblockFast` |
| 1.12 % | loop filter | `pixel.loopFilterByteWide` |
| 1.06 % | loop filter | `pixel.LoopFilterUV8` |
| 1.04 % | inter prediction | `pixel.filterVerticalFour8` |
| 0.95 % | bool/tokens | `vp8/boolcoder.(*Decoder).ReadBool` |
| 0.87 % | loop filter | `pixel.loadLFColumns[go.shape.[8]uint8]` |
| 0.82 % | loop filter | `pixel.loopFilterBytes` |
| 0.78 % | intra | `vp8/decoder.BuildIntraPredictorRefs` |
| 0.76 % | intra | `vp8/decoder.buildLeft` |
| 0.72 % | inter prediction | `vp8/decoder.decodeInterMacroblockAt` |
| 0.68 % | reconstruction add | `pixel.DCPairInPlaceInt32Native` |
| 0.66 % | inter prediction | `vp8/dsp.SixTapPredict16x16` |
| 0.65 % | reconstruction add | `pixel.AddConstant` |
| 0.64 % | loop filter | `pixel.loopFilterWide` |
| 0.57 % | modes/MV | `vp8/boolcoder.(*Decoder).ReadVP8InterRefFrame` |
| 0.55 % | loop filter | `pixel.storeLFUV` |
| 0.53 % | modes/MV | `vp8/decoder.ReadInterPredictionMode` |
| 0.51 % | itx | `vp8/decoder.dequantIDCTAddLumaBlocks` |
| 0.50 % | bool/tokens | `vp8/boolcoder.(*Decoder).readVP8MacroblockCoeffsSlow` |
54 changes: 54 additions & 0 deletions docs/perf/port-vp9-1tile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
### VP9 one tile, go-avkit/vpx v0.1.0 (single thread)

| stage | share |
|---|---|
| bool/tokens | 9.1 % |
| modes/MV | 11.9 % |
| inter prediction | 45.9 % |
| intra | 1.2 % |
| itx | 4.2 % |
| reconstruction add | 0.2 % |
| loop filter | 25.3 % |
| copy/alloc | 1.7 % |
| other | 0.4 % |
| unresolved | 0.1 % |
| total listed | 100.1 % |

Functions at or above 0.5 %:

| share | stage | function |
|---|---|---|
| 20.47 % | inter prediction | `pixel.filterWide8` |
| 11.14 % | inter prediction | `pixel.filterNarrow8` |
| 8.14 % | inter prediction | `vp9/codec.(*VP9Decoder).reconstructVP9InterPredictBlock` |
| 5.58 % | loop filter | `pixel.loopFilter8` |
| 3.80 % | bool/tokens | `vp9/decoder.DecodeCoefsFastPlaneAfterEOB` |
| 2.93 % | modes/MV | `vp9/codec.(*VP9Decoder).readVP9InterBlockModeInfo` |
| 2.58 % | loop filter | `pixel.loopFilterNonFlatBytes` |
| 2.50 % | loop filter | `pixel.loopFilterWide` |
| 2.28 % | inter prediction | `pixel.Filter` |
| 2.26 % | modes/MV | `vp9/codec.(*VP9Decoder).readVP9InterModeBlock` |
| 1.98 % | loop filter | `pixel.LoopFilter` |
| 1.78 % | modes/MV | `vp9/decoder.FindInterMvRefsFieldsIdx` |
| 1.69 % | bool/tokens | `vp9/codec.(*VP9Decoder).readVP9ResidueBlock` |
| 1.61 % | inter prediction | `pixel.narrow8Mode` |
| 1.57 % | modes/MV | `vp9/codec.(*VP9Decoder).storeVP9CurrentFrameMvs` |
| 1.45 % | bool/tokens | `vp9/codec.(*VP9Decoder).readVP9InterResiduePlane` |
| 1.31 % | itx | `vp9/dsp.inverseDCT16AVX2` |
| 1.25 % | copy/alloc | `runtime.memmove` |
| 1.21 % | loop filter | `pixel.loopFilterNonFlat` |
| 1.14 % | itx | `vp9/dsp.idct32Vec` |
| 1.13 % | intra | `vp9/codec.(*VP9Decoder).reconstructVP9IntraPredictTx` |
| 1.05 % | itx | `vp9/dsp.inverseTransformGenericGo` |
| 0.99 % | loop filter | `pixel.storeEdgeTile` |
| 0.85 % | inter prediction | `vp9/dsp.VpxConvolve8WithScratch` |
| 0.83 % | loop filter | `pixel.storeLFByteTileRows[go.shape.[4]uint8]` |
| 0.81 % | loop filter | `pixel.loadLFColumnTile[go.shape.[8]uint8]` |
| 0.76 % | bool/tokens | `vp9/bitstream.(*Reader).Read` |
| 0.76 % | loop filter | `pixel.loopFilterByteWide` |
| 0.70 % | loop filter | `pixel.storeEdgeTile14` |
| 0.66 % | loop filter | `vp9/codec.vp9FilterSelectivelyVertRow2` |
| 0.61 % | modes/MV | `vp9/decoder.readMvComponentFast` |
| 0.60 % | loop filter | `vp9/codec.vp9FilterSelectivelyHoriz` |
| 0.57 % | loop filter | `pixel.loopFilterWide16` |
| 0.51 % | modes/MV | `vp9/codec.(*VP9Decoder).vp9FindInterMvRefs` |
Loading
Loading