[FFmpeg-devel] [RFC] execute2/simplify dnxhdenc threading

Reimar Döffinger Reimar.Doeffinger
Sat Oct 10 17:51:02 CEST 2009

On Sat, Oct 10, 2009 at 05:08:35PM +0200, Reimar D?ffinger wrote:
> I haven't tested it too well since I just now realized that all the time
> I had compiled FFmpeg without thread support, if someone volunteers to
> benchmark the speeds of the different implementations they are more than
> welcome.

I did a test, but keep in mind that I did it so it shouldn't be
considered reliable.
Summary: new code has slightly higher speed and speedup for threads <= cores,
much faster and more predictable for threads > cores.
Much faster and more predictable behaviour should also be the case for
threads == cores on a loaded machine.
./ffmpeg_g -mbd rd -v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact -f image2 -vcodec pgmyuv -i ./tests/vsynth1/%02d.pgm -threads 5 -vcodec dnxhd -flags +ildct -s hd1080 -b 120Mb -pix_fmt yuv422p -an ././tests/data/a-dnxhd-1080i.mov
AMD Phenom(tm) 9750 Quad-Core Processor, 512k L2 Cache, 2 MB L3 Cache

old, execute:
Threads, Speedup, real, user, sys
1, 1.0000x, 1m55.433s, 1m55.375s, 0m0.064s
2, 2.0234x, 0m57.049s, 1m48.207s, 0m0.108s
3, 2.8385x, 0m40.667s, 1m43.706s, 0m0.140s
4, 3.7929x, 0m30.434s, 1m39.290s, 0m0.204s
5, 2.4492x, 0m47.130s, 2m07.700s, 0m0.232s
6, 2.3803x, 0m48.494s, 2m07.736s, 0m0.276s
7, 2.4441x, 0m47.230s, 1m59.067s, 0m0.280s
8, 2.5581x, 0m45.124s, 1m56.031s, 0m0.328s

new, execute2:
Threads, Speedup, real, user, sys, speedup compared to old code
1, 1.0000x, 1m54.440s, 1m54.219s, 0m0.104s,  0.9%
2, 2.0595x, 0m55.567s, 1m47.247s, 0m0.128s,  2.7%
3, 2.9948x, 0m38.213s, 1m41.870s, 0m0.136s,  6.4%
4, 4.0323x, 0m28.381s, 1m37.894s, 0m0.120s,  7.2%
5, 3.6989x, 0m30.939s, 1m40.074s, 0m0.128s, 52.3%
6, 3.4767x, 0m32.916s, 1m41.602s, 0m0.200s, 47.3%
7, 3.1418x, 0m36.425s, 1m45.531s, 0m0.228s, 29.7%
8, 2.9476x, 0m38.825s, 1m48.095s, 0m0.236s, 16.2%

More information about the ffmpeg-devel mailing list