Hello, > Here's an example program that you can test and time yourself. > > On my Core 2, I get > > [torvalds@woody ~]$ gcc -DCMOV -Wall -O2 t.c > [torvalds@woody ~]$ time ./a.out > 600000000 > > real 0m0.194s > user 0m0.192s > sys 0m0.000s > > [torvalds@woody ~]$ gcc -Wall -O2 t.c > [torvalds@woody ~]$ time ./a.out > 600000000 > > real 0m0.167s > user 0m0.168s > sys 0m0.000s Test was done on my laptop with gcc 4.1.1 and CPU: processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Pentium(R) 4 CPU 2.40GHz stepping : 9 cpu MHz : 2392.349 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr bogomips : 4786.36 clflush size : 64 I wrote a simple script that run each version of your code 100 times measuring the execution time. Then some simple gnuplot magic was applied. The result is attached (png file). - cmovne was faster with almost stable execution time (~171ms) - je-mov was slower and execution time varies Interpretation is up to you ;-) -- Regards, Mariusz Kozlowski
Attachment:
benchmark.png
Description: PNG image
- References:
- Re: kernel + gcc 4.1 = several problems
- From: Mikael Pettersson <[email protected]>
- Re: kernel + gcc 4.1 = several problems
- From: Grzegorz Kulewski <[email protected]>
- Re: kernel + gcc 4.1 = several problems
- From: Linus Torvalds <[email protected]>
- Re: kernel + gcc 4.1 = several problems
- Prev by Date: Re: [RFC][PATCH] use cycle_t instead of u64 in struct time_interpolator
- Next by Date: [PATCH 2.6.20-rc3] qconf Search Dialog
- Previous by thread: Re: kernel + gcc 4.1 = several problems
- Next by thread: Re: kernel + gcc 4.1 = several problems
- Index(es):