Speed differences between Linux and Windows - interesting

Started by
10 comments, last by aidan_walsh 20 years, 7 months ago
http://www.developerfusion.com/forums/topic.aspx?id=16681 This is interesting. A user at another forum I hang out at wrote a single loop application in C++, compiled them under VC++6 and GNU C++, and benchmarked them under both Win2K and Red Hat 9. The results, as detailed here, are somewhat remarkable. The source is also available, so you can download it yourself to draw your own conculsions. SketchSoft OFFLINE | SketchNews
www.aidanwalsh(.net)(.info)
Advertisement
I wouldn''t believe everything you read. I am seriously thinking of the possibility he built his windows code in the debug mode. This will cause a considerable amount of slowdown. I base this on the size of the file. Unless I''m writing a huge amount of code, or linking in a huge library, I''ve never had file sizes that big on a release mode in Visual Studio.

I also wonder if he was accounting for all processor usage. There are better ways to test then to use the windows task manager. I assume he was using time for linux. It is true linux can improve perfomance due to its finer graining on certain task. However, like I said. Read it with a grain of salt.
My name is my sig.
quote:
the source code is exactly the same for windows and linux, both were compiled with default values.


If you create a project with MSVC, the default configuration is debug mode. Thus, the comparison is pretty pointless.
GCC compiles without optimization by default, as well, but without the debugging information you probably get with MSVC. Debugging information could account for much of the filesize difference.

It''s pretty stupid to compare without optimization, though. Every decent package will compile with as much optimization as the package can handle anyway.

There are some significant performance differences (like IPC using pipes), but that stuff wasn''t mentioned.
---New infokeeps brain running;must gas up!
For a fair test it should be compiled with gcc under windows as well, not visual c++. The author mentions heavey use of new and delete whose implementations are dependent upon the runtime library - which will be different under different compilers.
You also have to realize different versions of windows perform differently, and different versions of linux perform differently (linux has even more possibilities than windows).

Having a conclusive and unbiased speed test between windows and linux is pretty tough to do. That said, linux tends to run a lot faster for me than windows for everyone I know... a lot of that could be that I know how to go through and optimize


Drakonite

[Insert Witty Signature Here]
Shoot Pixels Not People
I actually observed that UT 2k3 runs smoothly on an 800mhz , 256 mb ram, geforce 2 (redHat 9), but was hiccuping with win2k.
I was influenced by the Ghetto you ruined.
better frames rates on quake 3 and UT.[/]
I was influenced by the Ghetto you ruined.
"Under Linux, The compiled binary size = 22.6 kb
Under Windows The Compiled Binary sixe = 212.1 kb

almost 10 times bigger !
i putthis down to linked librarys, maybe windows was statically linking, and linux was dynamically linking ???????????
any comment ?????"

I have a comment. This guy''s an idiot. He''s obviously compiled with Debug. Not retail. The fact he could figured that one out pretty much ruins all credibility he may have mysteriously aquired. Debug EXEs are huge for even something like:

#define abs1(a) ((a<0) ? -(a) : (a))#define abs2(a) ((a<0) ? -a : a)#include <stdio.h>int abs3(int a){	return ((a<0)?-(a):(a));}void main(){	int i1=0, i2=0, i3=0, j1=0, j2=0, j3=0;	while(i1!=123)	{		printf("please enter 3 integers\n");		scanf("%d, %d, %d", &i1, &i2, &i3);		j1=abs1(++i1-2);		j2=abs2(++i2-2);		j3=abs3(++i3-2);		printf("j1 = %d, j2 = %d, j3 = %d\n", j1, j2, j3);	}}


That''s 181KB under VC6 in debug mode. BTW it''s one of my assignments for my programming class at a uni no less, which couldn''t possibly be any more lame.

As for why games get better performance under Linux; it''s because Linux has fewer layers between the OS and the card. Which is also why it''s a big giant bitch to install graphics cards on Linux.

I''ll keep my 3 frames per second and raise you 5 hours of work and $5 worth of asprin.

Ben


[ IcarusIndie.com | recycledrussianbrides.com | Got Linux? ]


Will Post For Food
I compiled his program as given and with retail it''s 60KB.

Ben

This topic is closed to new replies.

Advertisement