Solved

Linux faster than Windows?

Posted on 2006-11-02
5
339 Views
Last Modified: 2013-11-15
I'm writting a C++ console application. Basic input output ... with <fstream>

If take the idential code and run it on Linux(RedHat) g++ vs Windows (XP) Visual C++ 2005, which is faster? Why?
0
Comment
Question by:polkadot
5 Comments
 
LVL 18

Expert Comment

by:Morcalavin
ID: 17862531
That's a loaded question.  I mean, you've got more than just the os to deal with.  The type of processor, memory, number of running programs, compiler version, etc will all determine the speed.
0
 
LVL 20

Expert Comment

by:nedvis
ID: 17863838
0
 
LVL 27

Expert Comment

by:Nopius
ID: 17863883
YOU say, which is faster and I say WHY :-)
0
 
LVL 23

Accepted Solution

by:
Mysidia earned 500 total points
ID: 17864150
It depends on the code, what compiler you are using, and it depends on how you're running it in Redhat V.S. Windows, i.e. what other programs would be running at the same time.

It might certainly run more quickly on the same hardware under Redhat, with no windowing system online at all, and nothing major running in the background, than running under Windows, where the full GUI and many more background tasks are always operating, if the system memory availability is an issue at all.


All things other than the OS being equal, the execution time should be on the same scale in either OS, for such a simple application; very likely random factors that effect program execution will have a larger effect on any one run (So you would observe runs of the same program on the same configuration that were both slower and faster than the other system).


There are of course speed differences between Windows and Linux; however, nothing in your description has singled out a specific difference as applying to your application.


0
 
LVL 6

Expert Comment

by:_iskywalker_
ID: 17865145
It depends also on the linux system. I would say if you run it on gentoo. with no X no other services,
It would run faster in gentoo (gentoo optimize your Linux to your computer). But for file input output you wont
perceive a difference, since this operation can be done in a i386 in the same manner. It is basically a question if dma is on or not (direct access memory, it means that the harddisk will copy without any processor operation the data on the harddisk into the memory). It depends also with you use a usb disk. In linux you can say dont synchronize, so it will be 1000 times fastr, since it writes on the memory, and only if there is not enough memory or you umount the usb disk the file will be copied to the usb, only then. Windows normally copy at the very moment.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now