Solved

Linux faster than Windows?

Posted on 2006-11-02
5
337 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
Comment Utility
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
Comment Utility
0
 
LVL 27

Expert Comment

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

Accepted Solution

by:
Mysidia earned 500 total points
Comment Utility
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_
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
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.

762 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

12 Experts available now in Live!

Get 1:1 Help Now