|
-
September 10th, 2009, 08:04 AM
#1
Cross platform comparison
Hi,
Given a command line based C++ application written in pure C++ and using the Standard C and C++ libraries (thus being portable across OSes).
How would one compare the execution of performance of such an application across the following OSes ?
Windows , Solaris, Linux, AIX
For a given application which contains absolutely no OS specific calls (like the above), would there be a difference in execution performance across operating systems ?
What are the parameters that one needs to consider which contributing to difference in performance across OSes - the source code being absolutely the same ?
-
September 10th, 2009, 08:57 AM
#2
Re: Cross platform comparison
I have a little application written both for Windows and for Solaris. Unfortunately, it is so quick, I don't see any difference in terms of performance.
Moving data inside the processor's registry is very fast.
Moving data from RAM to registry is slower.
Moving data to video memory is slower.
Moving data from or to the disk, is much slower, about 1000 times (but it can be less if data is in the cache).
Moving data from or to a distant host, is much slower.
So, performance does not depend much about the machine, but about what the program does.
-
September 10th, 2009, 09:14 AM
#3
Re: Cross platform comparison
Thanks olivthill,
 Originally Posted by olivthill2
I have a little application written both for Windows and for Solaris.
So, performance does not depend much about the machine, but about what the program does.
From your experience. what would you expect a program to do which would bring about performance difference across Unix and Windows system ? Remember, the code base is the same on both.
For example, would reading a file using streams cause much of a difference across platforms ?
-
September 10th, 2009, 09:33 AM
#4
Re: Cross platform comparison
I wouldn't expect a significant difference across platforms at all, unless I was using drivers which were suboptimal on one of them. Linux is known for its GPU drivers not being quite as good as those on Windows, for instance.
-
September 10th, 2009, 11:42 AM
#5
Re: Cross platform comparison
 Originally Posted by humble_learner
For a given application which contains absolutely no OS specific calls (like the above), would there be a difference in execution performance across operating systems ?
Say you also use the same computer, then the only variable left is the quality of the compiler.
So the important factor really is choise of compiler. And because compilers differ in how well they handle different C++ constructs your programming style will be a factor to consider too.
-
September 10th, 2009, 11:34 PM
#6
Re: Cross platform comparison
If you are programming something especially processor intensive, you might notice a difference based on CPU Architecture (PowerPC vs. Intel vs. MIPS, 32-bit vs. 64-bit, etc) even if they are all rated at the same GHz. Certain operations may perform quicker on certain processors than others, but it tends to level out unless you are using those particular operations a lot.
-
September 14th, 2009, 09:01 AM
#7
Re: Cross platform comparison
 Originally Posted by jefranki
If you are programming something especially processor intensive, you might notice a difference based on CPU Architecture (PowerPC vs. Intel vs. MIPS, 32-bit vs. 64-bit, etc) even if they are all rated at the same GHz. Certain operations may perform quicker on certain processors than others, but it tends to level out unless you are using those particular operations a lot.
Could you elaborate on what would be processor intensive operations and non-processor intensive operations with respect to C or C++ code ? I suppose a sorting algorithm would be processor intensive while reading a file would be non-processor intensive. Am I correct here ?
Looks like from this discussion, there are the following key areas that could be reasons for differences - the code being the same
1. Quality of compiler across the platforms
2. Device driver implementations across the platforms
3. Processor architecture coming into play during processor intensive operations
Given an application coded in pure C++ which takes - say 2 seconds to execute on Windows, is it safe to promise the customer that the execution time will be the same in case the project involves porting to Linux/Unix platforms ?
-
September 14th, 2009, 10:35 AM
#8
Re: Cross platform comparison
It's safe to say it will probably be similar. There are too many variables to guarantee exactly the same performance.
-
September 14th, 2009, 11:49 PM
#9
Re: Cross platform comparison
Thanks Lindley. Any comments on the quote below ?
 Originally Posted by humble_learner
Could you elaborate on what would be processor intensive operations and non-processor intensive operations with respect to C or C++ code ? I suppose a sorting algorithm would be processor intensive while reading a file would be non-processor intensive. Am I correct here ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|