[Ffmpeg-devel] yet another silly int vs. float benchmark
Michael Niedermayer
michaelni
Sat May 21 18:33:29 CEST 2005
Hi
On Saturday 21 May 2005 18:06, Michael Niedermayer wrote:
> Hi
>
> heres another benchmark proggy, advantages over the others
> 1. pure c
> 2. ~40 lines of code, can be easily done in less i know ...
> 3. tries to test both the case where each instruction depends upon the
> previous one and where the instructions are a little more independant
500mhz pentium 3:
100 ; needed 32 cycles -> 32 cycles per operation
100 iv[0]+=iv[1];iv[1]+=iv[0]; needed 233 cycles -> 116 cycles per operation
100 iv[0]*=iv[1];iv[1]*=iv[0]; needed 832 cycles -> 416 cycles per operation
100 fv[0]+=fv[1];fv[1]+=fv[0]; needed 884 cycles -> 442 cycles per operation
100 fv[0]*=fv[1];fv[1]*=fv[0]; needed 1032 cycles -> 516 cycles per operation
100 iv[0]+=iv[1];iv[1]+=iv[2];iv[2]+=iv[3];iv[3]+=iv[4];iv[4]+=iv[5]; needed 301 cycles -> 60 cycles per operation
100 iv[0]*=iv[1];iv[1]*=iv[2];iv[2]*=iv[3];iv[3]*=iv[4];iv[4]*=iv[5]; needed 555 cycles -> 111 cycles per operation
100 fv[0]+=fv[1];fv[1]+=fv[2];fv[2]+=fv[3];fv[3]+=fv[4];fv[4]+=fv[5]; needed 542 cycles -> 108 cycles per operation
100 fv[0]*=fv[1];fv[1]*=fv[2];fv[2]*=fv[3];fv[3]*=fv[4];fv[4]*=fv[5]; needed 1039 cycles -> 207 cycles per operation
800mhz duron
100 ; needed 11 cycles -> 11 cycles per operation
100 iv[0]+=iv[1];iv[1]+=iv[0]; needed 204 cycles -> 102 cycles per operation
100 iv[0]*=iv[1];iv[1]*=iv[0]; needed 796 cycles -> 398 cycles per operation
100 fv[0]+=fv[1];fv[1]+=fv[0]; needed 720 cycles -> 360 cycles per operation
100 fv[0]*=fv[1];fv[1]*=fv[0]; needed 720 cycles -> 360 cycles per operation
100 iv[0]+=iv[1];iv[1]+=iv[2];iv[2]+=iv[3];iv[3]+=iv[4];iv[4]+=iv[5]; needed 211 cycles -> 42 cycles per operation
100 iv[0]*=iv[1];iv[1]*=iv[2];iv[2]*=iv[3];iv[3]*=iv[4];iv[4]*=iv[5]; needed 1014 cycles -> 202 cycles per operation
100 fv[0]+=fv[1];fv[1]+=fv[2];fv[2]+=fv[3];fv[3]+=fv[4];fv[4]+=fv[5]; needed 680 cycles -> 136 cycles per operation
100 fv[0]*=fv[1];fv[1]*=fv[2];fv[2]*=fv[3];fv[3]*=fv[4];fv[4]*=fv[5]; needed 509 cycles -> 101 cycles per operation
both compiled with gcc -O3 -fomit-frame-pointer sillybench.c -o sillybench
--
Michael
More information about the ffmpeg-devel
mailing list