This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[novice] gcc compiler result's speed disappointing on UlraSPARCIIe / Solaris V9? What goes wrong?


Hello,

Short question:
I am comparing a simple c++ program when running on
two different systems. I expected the program on the
SPARC to run much faster then when running it on
the laptop. Am I making a thinking error here? I ran
all the tests, read the FAQ, tried different optimizer
options, libraries and other compiler and linker
options to no effect. Both systems are running as
'clean' as possible and working without any trouble.
Both programs are compiled using the
compiler's default settings. But the program on the
Intel is finished in 5min 12sec while the program
running on the SPARC needs 8min 16sec. The Intel's exe
is also much larger then the one on the SPARC made
with gcc. I don't know if this makes any difference.

System A:
IBM Thinkpad 390E, 333Mhz Intel Pentium 2, 256MB RAM,
MS Windows 2000, MS Visual C++ 6.0 compiler, 172109
byte size exe, runtime: 0:05:12 (WIN32 terminal app)

System B:
SUNBlade 100, 500Mhz UltraSPARCIIe, 512MB RAM, Solaris
V9, g++ 3.2 compiler, 11320 byte size exe, runetime:
0:08:16 (console app)

This is the program's main loop, very simple test prog
to check primes, al types are 'long':

while (listPos < listSize)
{
     prime = true;
     n = 1;
     while ((n < (listPos / 2 )) && (prime))
     {
         priem = !((currentPrimeCandidate %
primeList[n]) == 0);
         n++;
      }

     if ( prime)
     {
         primeList[listPos] = currentPrimeCandidate;
         listPos++;
     }

   currentPrimeCandidate ++;
   currentPrimeCandidate ++;
}

Is there a reason that this loop executes faster on a
333Mhz Intel then a 500Mhz UltraSPARCIIe?
I admid that I'm new to the unix environment so I
might be doing something completly wrong here.

Also, when compiling the source from the Solaris
command line, I can't execute a.out by typing the
program's name (a.out) at the '$' prompt. I have to
look it up with the File Manager and click it. This
can't be right, right?

Hope you can shed some light on this 'problem' I seem
to have.

regards, Bas

=====
Disclaimer: This e-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addresse(s). dr.Bas rules out any and every liability resulting from any electronic transmission.

Visit the dr.Bas page: http://home.wanadoo.nl/ribbers

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]