Timing variations (was Re: [Ffmpeg-devel] benchmark of different CABAC routines)

Uoti Urpala uoti.urpala
Thu Oct 12 00:21:19 CEST 2006


I wrote a simple program to test timing variations. It repeats a loop
and the records number of timings in various speed groups. First
argument is the number of repeats, second is the length of each timed
loop.

gcc -std=c99 -O3 timingtest.c
./a.out 10000000 100

Sample result from console with no X and few other programs running:
512-1024: 532.1 9996483
1024-2048: 1061.4 387
4096-8192: 5660.4 2725
8192-16384: 8789.2 365
16384-32768: 21403.6 23
32768-65536: 53491.3 9
65536-131072: 90390.7 6
131072-262144: 217157.0 1
262144-524288: 383460.0 1

Sample result from X with various other programs running (no high CPU
use programs):
256-512: 444.4 8
512-1024: 532.1 9996068
1024-2048: 1084.8 561
4096-8192: 5692.2 2463
8192-16384: 9346.5 358
16384-32768: 24120.8 27
32768-65536: 45781.4 134
65536-131072: 82300.3 315
131072-262144: 172464.1 58
262144-524288: 329019.0 1
524288-1048576: 625473.5 2
1048576-2097152: 2087544.0 2
2097152-4194304: 2316666.0 2
8388608-16777216: 14419727.0 1

First is the interval, then average and count of samples in this
interval. Basic timer interrupt effect is clearly in the 4096-8192
interval. Neither example has any samples between 2048 and 4096. From
these numbers it looks like skipping samples over about 4000 cycles
(40000 dezicycles) would be a good threshold on this machine for
functions which are expected to use less time than that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timingtest.c
Type: text/x-csrc
Size: 913 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061012/8f43d6d0/attachment.c>



More information about the ffmpeg-devel mailing list