Solved

Linux faster than Windows?

Posted on 2006-11-02
5
340 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

821 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