public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel 2.6 speed
@ 2005-07-24 19:12 Ciprian
  2005-07-24 19:41 ` Brice Goglin
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Ciprian @ 2005-07-24 19:12 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi guys!

I got a question for you. Apparently kernel 2.6 is
much slower then 2.4 and about 30 times slower then
the windows one.

I'm not an OS guru, but I ran a little and very simple
test. The program bellow, as you can see, measures the
number of cycles performed in 30 seconds.

//----------------- START CODE --------------------

#include <stdio.h>
#include <time.h>


int main()
{
time_t initialTime;
time_t testTime;
long counter = 0;
double test = 1;


time(&initialTime);
testTime = initialTime;

printf("Here we go...\n");

while((testTime-initialTime) < 30)
{
time(&testTime);
test /= 10;
test *= 10;
test += 10;
test -= 10;

counter ++;

}

printf("No. of cycles: %ld\n", counter);

return 0;
}

//---------------- END CODE -------------------


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.

I published my little test on several forums and I
wasn't the only one who got these results. All the
other users using 2.6 kernel obtained similar results
regardless of the CPU they had (Intel or AMD). 

Also I downloaded the latest kernel (2.6.12),
configured it specifically for my machine, disabled
all the modules I don't need and compiled it. The
result was a 1.7 MB kernel on which KDE moves faster,
but the processing speed it's the same - same huge
speed ratios.

Also, it shouldn't have any importance, but my HDD is
SATA so the specific modules were required. I don't
think its SCSI modules have any impact on the
processing speed, but you know more on the kernel
architecture then I do.

Now, can anyone explain this and suggest what other
optimizations I should use? The 2.4 version was a lot
faster. I thought the newer versions were supposed to
work faster (or at least just as fast) AND to offer
extra features.

Any help would appreciate.

Thanks,
Ciprian



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: kernel 2.6 speed
@ 2005-08-03 15:31 Henrik Holst
  0 siblings, 0 replies; 15+ messages in thread
From: Henrik Holst @ 2005-08-03 15:31 UTC (permalink / raw)
  To: linux-kernel, cipicip

>> 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.

I know that this benchmark is totally flawed, but I couldn't refuse to 
run it on my own and
to my surprise my numbers where the reverse! Running 2.6.12 gave my 
roughly 73 million
"cycles" while WinXP only gave me 28 million "cycles".

This result made me further test the difference in time() in Linux and 
WinXP and on my hw
(Compaq Evo N800c Laptop) it turns out that the time() call takes 
roughly 0.4 us in Linux vs
1.0 us in WinXP.

Using the GetSystemTime() functions in WinXP yielded the same values as 
time() did in Linux,
so it seams like that atleast on my hw that the time() and 
gettimeofday() functions are as fast
or faster than in WinXP. The question is of course why my results differ 
so much from Ciprians.

/Henrik H

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-08-03 15:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-24 19:12 kernel 2.6 speed Ciprian
2005-07-24 19:41 ` Brice Goglin
2005-07-24 19:47 ` Dag Nygren
2005-07-24 20:40 ` Puneet Vyas
2005-07-24 21:03 ` Florin Malita
2005-07-24 22:49   ` Lee Revell
2005-07-25 19:52     ` Bill Davidsen
2005-07-24 21:46 ` Jan Engelhardt
2005-07-24 23:47 ` Alan Cox
2005-07-25  4:10   ` Florin Malita
2005-07-25  5:18     ` Willy Tarreau
2005-07-25  6:47     ` Ciprian
2005-07-26  5:55     ` cutaway
2005-07-26 19:45       ` Florin Malita
  -- strict thread matches above, loose matches on Subject: below --
2005-08-03 15:31 Henrik Holst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox