lkml.org 
[lkml]   [2005]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel 2.6 speed
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-24 21:45    [W:0.050 / U:45.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site