Repository navigation
Closed
Description
$ perf record target/release/rav1e Bosphorus_1920x1080_120fps_420_8bit_YUV.y4m -o /dev/null --tiles 4 --threads 4 --limit 64 -s0
Couldn't synthesize bpf events.
> Using y4m decoder: 1920x1080p @ 30/1 fps, 4:2:0, 8-bit
> Encoding settings: keyint_min=12 keyint_max=240 quantizer=100 bitrate=0 min_quantizer=0 low_latency=false tune=Psychovisual rdo_lookahead_frames=40 min_block_size=4x4 max_block_size=64x64 multiref=true fast_deblock=false reduced_tx_set=false tx_domain_distortion=false tx_domain_rate=false encode_bottomup=true rdo_tx_decision=true prediction_modes=Complex-All include_near_mvs=true no_scene_detection=false cdef=true use_satd_subpel=true non_square_partition=true enable_timing_info=false fine_directional_intra=true
> CPU Feature Level: AVX2
> Using 4 tiles (2x2)
> encoded 64/64 frames, 0.100 fps, 2342.27 Kb/s, est. size: 0.60 MB, est. time: 0s, elap. time: 10m 38s
> ----------
> Key frame: 1 | avg QP: 79.00 | avg size: 104170 B
> Inter frame: 63 | avg QP: 138.00 | avg size: 8260 B
> Intra only frame: 0 | avg QP: 0.00 | avg size: 0 B
> Switching frame: 0 | avg QP: 0.00 | avg size: 0 B
> ----
[ perf record: Woken up 1229 times to write data ]
[ perf record: Captured and wrote 308.871 MB perf.data (8096427 samples) ]
$ perf report
# Overhead Command Shared Object Symbol
# ........ ....... .................. .........................................................................................................................................................................
#
20.33% rav1e libc-2.30.so [.] __memmove_avx_unaligned_erms
11.39% rav1e rav1e [.] rav1e::encoder::encode_tx_block
9.44% rav1e rav1e [.] <rav1e::ec::WriterBase<S> as rav1e::ec::Writer>::symbol_with_update
7.59% rav1e rav1e [.] rav1e::rdo::cdef_dist_wxh_8x8
5.29% rav1e rav1e [.] rav1e::context::block_unit::<impl rav1e::context::cdf_context::ContextWriter>::write_coeffs_lv_map
3.72% rav1e rav1e [.] rav1e::context::transform_unit::<impl rav1e::context::cdf_context::ContextWriter>::get_nz_map_contexts
3.60% rav1e rav1e [.] rav1e::asm::x86::transform::forward::forward_transform_avx2
2.68% rav1e rav1e [.] rav1e::encoder::encode_block_post_cdef
2.22% rav1e rav1e [.] rav1e::rdo::compute_distortion
1.85% rav1e rav1e [.] <rav1e::ec::WriterBase<S> as rav1e::ec::Writer>::bit
1.77% rav1e rav1e [.] __rust_probestack
1.43% rav1e rav1e [.] rav1e::rdo::luma_chroma_mode_rdo::_$u7b$$u7b$closure$u7d$$u7d$::hfd13f0685c9817e4
1.21% rav1e rav1e [.] rav1e::quantize::QuantizationContext::update
1.03% rav1e rav1e [.] rav1e::asm::x86::quantize::dequantize_avx2
0.94% rav1e rav1e [.] rav1e::partition::get_intra_edges
0.82% rav1e rav1e [.] rav1e::context::block_unit::BlockContext::get_txb_ctx
0.78% rav1e rav1e [.] rav1e::predict::PredictionMode::predict_inter_single
0.77% rav1e rav1e [.] rav1e::encoder::write_tx_blocks
0.76% rav1e rav1e [.] rav1e::asm::x86::transform::forward::daala_fdct32
0.72% rav1e rav1e [.] rav1e::asm::x86::transform::forward::daala_fdct_ii_16
0.64% rav1e rav1e [.] rav1e::transform::forward_shared::Txfm2DFlipCfg::fwd
0.62% rav1e rav1e [.] rav1e::rdo::rdo_tx_size_type
0.61% rav1e rav1e [.] core::cmp::PartialOrd::le
0.61% rav1e rav1e [.] rav1e::asm::x86::transform::forward::daala_fdct8
0.59% rav1e rav1e [.] rav1e::context::block_unit::<impl rav1e::context::cdf_context::ContextWriter>::fill_neighbours_ref_counts
0.55% rav1e rav1e [.] rav1e::encoder::motion_compensate
0.54% rav1e rav1e [.] rav1e::asm::x86::transform::inverse::inverse_transform_add
0.51% rav1e libc-2.30.so [.] __memset_avx2_unaligned_erms
0.50% rav1e rav1e [.] rav1e::predict::PredictionMode::predict_inter
Metadata
Metadata
Assignees
Labels
No labels
Activity
lu-zero commentedon Jan 22, 2021
according to callgrind:
Digging further:
And further:
So we have
BlockContext::rollback()andContextWriter::rollback().Ideally we could instrument the CdfContext struct further. It is 17774 bytes.
negge commentedon Feb 4, 2021
Nice, with f9c026f and 351f7c8 I am now seeing a ~15% speed-up from 10m 48s to 9m 26s with the same configuration. The calls to unaligned memmove are gone.
Using git hash 61133e3 (before log)
Using git hash 351f7c8 (after log)
lu-zero commentedon Feb 4, 2021
On broadwell this is what I get doing the average of 5 runs
lu-zero commentedon Feb 4, 2021
Same setting on the honeycomb-lx2k

barrbrain commentedon Feb 8, 2021
How much of this is from
BlockContext::rollback(BlockContextCheckpoint)?Are there more opportunities to recover some cycles here?
lu-zero commentedon Feb 8, 2021
The
BlockContextis another candidate but is much smaller.barrbrain commentedon Feb 10, 2021
PR #2667 should resolve the final significant group of calls to
memmove. My testing with linux-perf showed 0.4% remained inmemmoveafter applying those changes.negge commentedon Feb 18, 2021
Closing, thanks everyone who worked on this