Re: kernel 2.6 speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le 24.07.2005 21:12, Ciprian a écrit :
> while((testTime-initialTime) < 30)
> {
> time(&testTime);
> test /= 10;
> test *= 10;
> test += 10;
> test -= 10;
> 
> counter ++;
> 
> }

> In windows were performed about 300 millions cycles,
> while in Linux about 10 millions. This test was run on
> Fedora 4 and Suse 9.2 as Linux machines, and Windows
> XP Pro with VS .Net 2003 on the MS side. My CPU is a
> P4 @3GHz HT 800MHz bus.

Hi,

This test gives you the price of the time function on each OS
since the 4 arithmetical operations are shorter to compute
(several cycles against tons of cycles). It appears that the time
function costs about 3 us on Linux against 0.1 us on Windows.
This function is probably very OS-dependant since it depends on
how the kernel handles timing. You can't compare anything as small
as these arithmetical operations like this.  Using rdtsc would be
much better.

Anyway, if you just want to measure the cost of arithmetic
operations, there shouldn't be any difference in the results
between Linux and Windows (with a safe timing method).

Brice
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux