473,738 Members | 3,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

gcc 64bit compiler does not offer any speed advantage

I must say i didn't expect this. I just did some measures on FreeBSD
6.2 with gcc 3.4.6 and there is absolutely no significant difference
between 32 and 64 bit mode - neither in compilation speed, nor in
speed of the compiled result.

As a benchmark i took a bootstrap of the SmallEiffel Compiler (which
has 38 files with around 100 kloc). The times i got were very
reliable. The bootstraping (compile the c files from last eiffel
compiler stage, and then use this to regenerated the eiffel compiler
and all tools) took

32Bit: 2,58 (wall), 2,57 (user), 0,3 (system) = exe size:
1,757,177 byte
64Bit: 2,48 (wall), 2,42 (user) , 0,5 (system) = exe size:
2,179,326 byte
This is a measure of the quality of the generated code

The compilation only
13,9 (32bit) <-16,2 (64 bit) sec -O0
33,5 (32bit) <-31,4 (64 bit) sec -02
55,7 (32bit) <-51,9 (64 bit) sec -03

So the new registers are just not giving any benefits that are not
consumed by the additional memory overhead.

I'm mostly surprised that the code generation part of gcc (speed of
the compiler) is also the same, because this is the most terrible
weakness for any of my development (it has to do with how the eiffel
compiler works). MSVC is 16x faster then (using precompiled headers)
gcc (without precompiled headers). I can't compare them again because
the OS are now on different machines but precompiled headers are
almost useless on gcc - and the way Eiffel generates the header file
is already perfect (only one header per c file, and first statement in
each file). I got results from -8% (gcc 4.x) upto 28% (gcc 3.4.6) .

So i always believed that the problem is the code generator of gcc,
which makes sense because Sun Studio 11 on SPARC is 4x faster per Mhz
then the Intel86 code (because of the easy calling conventions for the
compiler) and the tinycc is 9x faster then gcc. Both aren't using
precompiled headers.

But the additional number of registers seems to not reduce the
complexity of the code generator. I really don't understand this. I
guess it is the one-for-all overengineered architecture that slows
down the whole gnu collection.

Unfortunately the only other useable c compiler on linux i could test
was almost as slow as gcc. Seems that Intel does only care about speed
of the executable.

So is there something useable out there (tinycc is unfortunately full
of bugs and not anymore maintained) that is at least 3-5 times faster
then gcc. It would make my development much easier.

Ah yes, on my iMac PPC i also tried it, codewarrior <-gcc was only
giving a little bit less then 2x performance. But this compiler does
not exist anymore. OpenWatcom is also not developed and the lcc-
linux32/lcc-linux64 seem to be not yet available.

Apr 18 '07 #1
19 3809
llothar a écrit :
I must say i didn't expect this. I just did some measures on FreeBSD
6.2 with gcc 3.4.6 and there is absolutely no significant difference
between 32 and 64 bit mode - neither in compilation speed, nor in
speed of the compiled result.
I would not expect anything else. For what reason you would think
64 bit is better?
As a benchmark i took a bootstrap of the SmallEiffel Compiler (which
has 38 files with around 100 kloc). The times i got were very
reliable. The bootstraping (compile the c files from last eiffel
compiler stage, and then use this to regenerated the eiffel compiler
and all tools) took

32Bit: 2,58 (wall), 2,57 (user), 0,3 (system) = exe size:
1,757,177 byte
64Bit: 2,48 (wall), 2,42 (user) , 0,5 (system) = exe size:
2,179,326 byte
What machine were you using? Without that, absolute times are
meaningless.
This is a measure of the quality of the generated code

The compilation only
13,9 (32bit) <-16,2 (64 bit) sec -O0
33,5 (32bit) <-31,4 (64 bit) sec -02
55,7 (32bit) <-51,9 (64 bit) sec -03

So the new registers are just not giving any benefits that are not
consumed by the additional memory overhead.
Yes. Code bloat, and larger memory footprint eat away the benefits
of the new registers.
I'm mostly surprised that the code generation part of gcc (speed of
the compiler) is also the same, because this is the most terrible
weakness for any of my development (it has to do with how the eiffel
compiler works).
lcc-win32 is 20 x faster than gcc. I think most compilers are faster
than gcc since gcc has never cared about this. The team has apparently
other objectives.

MSVC is 16x faster then (using precompiled headers)
gcc (without precompiled headers). I can't compare them again because
the OS are now on different machines but precompiled headers are
almost useless on gcc - and the way Eiffel generates the header file
is already perfect (only one header per c file, and first statement in
each file). I got results from -8% (gcc 4.x) upto 28% (gcc 3.4.6) .

So i always believed that the problem is the code generator of gcc,
which makes sense because Sun Studio 11 on SPARC is 4x faster per Mhz
then the Intel86 code (because of the easy calling conventions for the
compiler) and the tinycc is 9x faster then gcc. Both aren't using
precompiled headers.

But the additional number of registers seems to not reduce the
complexity of the code generator. I really don't understand this. I
guess it is the one-for-all overengineered architecture that slows
down the whole gnu collection.
Exactly. One of the symptoms for this situation is that -O2 generates
BETTER code thanh -O3 ... -O9.

The problem with this type of software is that the only thing that
people are interested in is to put some more code, since the
recognition goes to "the guy that added feature xxx to gcc" and
never to the "guy that erased unneeded feature xxx from gcc".

This means that evertbody has his/her pet interest with the
project, and not a lot of people care about the project in general.

This means that many features get added to the software but never
a reviw of all the optimizations is done to see if it is wortwhile
to KEEP them.

Another big difficulty of the gcc project is that it is a compiler
that should run anywhere, what means a lot of back ends, and
therefore a lot of problems. Microsoft has less problems since it runs
essentially on x86 and then only in one operating system...
Unfortunately the only other useable c compiler on linux i could test
was almost as slow as gcc. Seems that Intel does only care about speed
of the executable.
You could use lcc-lin64 but it is NOT free under linux, you have
to buy it.
So is there something useable out there (tinycc is unfortunately full
of bugs and not anymore maintained) that is at least 3-5 times faster
then gcc. It would make my development much easier.
Yes, use lcc-lin64.
Ah yes, on my iMac PPC i also tried it, codewarrior <-gcc was only
giving a little bit less then 2x performance. But this compiler does
not exist anymore. OpenWatcom is also not developed and the lcc-
linux32/lcc-linux64 seem to be not yet available.
They are available but need some tweaking.
Apr 18 '07 #2
I would not expect anything else. For what reason you would think
64 bit is better?
Only for the better register model. For todays computer speed the CPU
ISA seems really not so important any more. It's good to see that
the large address space is not giving a high penality. But i have to
check the
speed of the Boehm-Weisser-GC before i make a final comparision.
32Bit: 2,58 (wall), 2,57 (user), 0,3 (system) = exe size:
1,757,177 byte
64Bit: 2,48 (wall), 2,42 (user) , 0,5 (system) = exe size:
2,179,326 byte

What machine were you using? Without that, absolute times are
meaningless.
It's an AthlonX2 4400 but no parallel execution. The numbers itself
are
irrelevant I just wanted to point out how equal the numbers are
(less then 1%) and even the exe size is only 20% larger.

At first i even expected the program was wrongly compiled so
i added a "assert(sizeof( void*) == 8)" but it was okay.
lcc-win32 is 20 x faster than gcc. I think most compilers are faster
than gcc since gcc has never cared about this. The team has apparently
Indeed. I see this as a huge problem.
You could use lcc-lin64 but it is NOT free under linux, you have
to buy it.
Don't have a problem as long as the price is reasonable. But i need
some more
information. I purchased Code-Warriors Linux and Kylix. Both were
terrible mistakes
and i never got Kylix compile a simple hello world. But i talked with
Friedrich about
it and it seems that you are going a better way. Is there any website,
i looked at
his Q website and couldn't find anything.
Apr 18 '07 #3
Your post is more topical in a GCC compiler group.

I guess you are using it wrong, or in areas where there is no benefit.

In bitboard chess programs (which need 64 bit integers) there is a big
speedup. If your program does not use 64 bit integers heavily, there
is no reason to expect a big speed increase (unless you need to access
more than 2 GB of RAM, which is another place where 64 bit model
shines).

At any rate, if you want to get better performance using the GCC
compiler suite, why not ask in one of the myriad GCC compiler
newsgroups?

If you use all the performance options pertinant for your hardware and
do profile guided optimization, you can get performace pretty close to
the commercial compilers.

Apr 18 '07 #4
"jacob navia" <ja***@jacob.re mcomp.frwrote in message
news:46******** **************@ news.orange.fr. ..
llothar a écrit :
>I must say i didn't expect this. I just did some measures on
FreeBSD 6.2 with gcc 3.4.6 and there is absolutely no
significant difference between 32 and 64 bit mode - neither
in compilation speed, nor in speed of the compiled result.

I would not expect anything else. For what reason you would think
64 bit is better?
It all depends on the specific code. Some programs get a huge boost, nearly
100%, from the additional registers. Others get hammered by the cache
effects of larger pointers. Most programs are not significantly affected by
either factor -- or they cancel each other out.

S

--
Stephen Sprunk "Those people who think they know everything
CCIE #3723 are a great annoyance to those of us who do."
K5SSS --Isaac Asimov
--
Posted via a free Usenet account from http://www.teranews.com

Apr 18 '07 #5
It all depends on the specific code.

Yes and Compilation seems to be extremely difficult for current CPU's.
I also got no significant difference when i moved from AthlonX2 to a
Core2Duo System where i expected from other application benchmarks
that there is much more benefit of larger caches (4MB instead of 1MB).
But no, almost linear to the very minor improvent in CPU frequency.

Apr 18 '07 #6
If you use all the performance options pertinant for your hardware and
do profile guided optimization, you can get performace pretty close to
the commercial compilers.
Again, you also don't understand it. Seems to be pretty hard for many
people.

I don't care (most of the time, at least when i'm using -O0) about the
speed of the compilee,
but the speed of the compiler is very very important for me (because
of problems with
the used eiffel compiler technology). I'm concerned about my most
important resource: time.
If i have a long edit-compile-run cycle it is reducing productivity a
lot.

And here gcc is hopeless behind compared to LCC-Win32, MSVC, Borland C
or TinyCC.
Apr 18 '07 #7
llothar <ll*****@web.de wrote:
If you use all the performance options pertinant for your hardware and
do profile guided optimization, you can get performace pretty close to
the commercial compilers.
Again, you also don't understand it. Seems to be pretty hard for many
people.
I don't care (most of the time, at least when i'm using -O0) about the
speed of the compilee,
but the speed of the compiler is very very important for me (because
of problems with
the used eiffel compiler technology). I'm concerned about my most
important resource: time.
If i have a long edit-compile-run cycle it is reducing productivity a
lot.
And here gcc is hopeless behind compared to LCC-Win32, MSVC, Borland C
or TinyCC.
<OT>

If you're proficient enough, maybe it might be worth your time to invest in
TinyCC development. The project is on the verge of a fork already. There are
two developers in particular who have very nearly forked the project, given
that they meticulously maintain patch sets. It just needs that extra push
and promise of community involvement, and one of them might actually pick up
the torch.

Alternatively, you can always try KenCC from the Plan9 project. Google
Summer of Code has a project for porting it to POSIX systems.

I've never had any luck with TenDRA.

Time is indeed precious, but in this day and age of Free Software complaints
aren't worth much when one can fix the issues themselves. You can find time
in the damnedest places....

I'm assuming that you've already tried GCC 4.2, are using -pipe, and are
unable to employ Make magic to cut down on the number of units which need
recompiling each cycle.

</OT>
Apr 18 '07 #8
On 18 Apr 2007 06:25:55 -0700, in comp.lang.c , llothar
<ll*****@web.de wrote:
>As a benchmark i took a bootstrap of the SmallEiffel Compiler (which
has 38 files with around 100 kloc).
Too trivial an example. Try running the greeks calculation for a book
of structured credit derivatives.... :-)
>32Bit: 2,58 (wall), 2,57 (user), 0,3 (system) = exe size:
1,757,177 byte
64Bit: 2,48 (wall), 2,42 (user) , 0,5 (system) = exe size:
2,179,326 byte
This is a measure of the quality of the generated code
Size is a measure of quality?????!!
>So the new registers are just not giving any benefits that are not
consumed by the additional memory overhead.
More likely your test case is too limited. You need something that
really exercises the 64-bitness of the system. Compilation isn't
likely to be that beast.

By the way, your post is offtopic in CLC, which is for discussing the
C Language, not quality of implementations , however interesting.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 18 '07 #9
On 18 Apr 2007 14:00:38 -0700, in comp.lang.c , llothar
<ll*****@web.de wrote:
>If you use all the performance options pertinant for your hardware and
do profile guided optimization, you can get performace pretty close to
the commercial compilers.

Again, you also don't understand it. Seems to be pretty hard for many
people.
Be careful not to be condescending to your listeners, they're likely
to object to being told they're stupid. Consider whether you properly
explained yourself in the first case.
>If i have a long edit-compile-run cycle it is reducing productivity a lot.
Sounds like you could try optimising your code perhaps, instead of
blaming your tools (talking of being condescending).
>And here gcc is hopeless behind compared to LCC-Win32, MSVC, Borland C
or TinyCC.
You are free to invest your time in resolving this, instead of just
criticising the implementors of gcc who its worth remembering don't
get paid to implement gcc, and do it in their spare time.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 18 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2580
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP instruction that can be slower. I created three functions in an array. Array is called pArray_Func(). pArray_Func() contains three functions. "xx" can be used to point each function. Let say, I have over 1,000 functions. I would put "inline"...
8
5659
by: Nathan Waddington | last post by:
Hello Everyone, My program receives a string representation of a 64bit hex number that needs to be displayed as the decimal number it represents. The compiler that is being used is Dynamic C and (alas) it does not support 64bit numbers. So far i have been able to take the least significant 4 bytes and convert them correctly, but when i try to take the most significant 4 bytes i am unable to convert them correctly. Below are the 3...
10
2349
by: Henrik Andersen | last post by:
Hi newsgroup Does the c++ compiler generate faster code at execution time than the C# compiler? Does the c++ compiler have more optimisations than the C# compiler? Thanks in advance!
5
3030
by: shobhah | last post by:
Hi, We have a complete succsssfully working product on 32bit sparc solaris machine for which compiler used is CC 5.8 Now we are migarting our product from 32 bit to 64bit sparc solaris machine. While porting we need 64 bit compiler issues for our application product which is wriiten in completely C++. We tried with -xarch=v9 and -xport64=full compiler options to find out 64bit porting problems. But we did not find any issues for our...
31
2795
by: Mark Dufour | last post by:
Hi all, I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an optimizing Python-to-C++ compiler. Shed Skin allows for translation of pure (unmodified), implicitly statically typed Python programs into optimized C++, and hence, highly optimized machine language. Besides many bug fixes and optimizations, these releases add the following changes: -support for 'bisect', 'collections.deque' and 'string.maketrans'
1
1967
by: GaryDean | last post by:
We have been developing all of our .net applications on 32 bit windows using 32 bit SQL Server. We are being asked to now deploy to servers running 64bit windows and 64bit SQL Server. Are there issues? Differences? Should we switch our dev environment to 64bit. What is the advantage of going with 64 bit servers other than being able to address more memory? Thanks, Gary
18
3929
by: cman | last post by:
Hi guys, why does this fail raising bad_alloc int *v = new int ; if this succeeds int *v = (int *) malloc((unsigned)6000000000) both on the same machine, same compiler g++, 64bit linux red hat enterprise 4, no ulimits on the user, enough virtual memory ecc... in both cases compiled with
4
3295
by: legrape | last post by:
I am porting a piece of C code to 64bit on Linux. I am using 64bit integers. It is a floating point intensive code and when I compile (gcc) on 64 bit machine, I don't see any runtime improvement when optimizing -O3. If I construct a small program I can get significant (>4x) speed improvement using -O3 versus -g. If I compile on a 32 bit machine, it runs 5x faster on the 64 bit machine than does the 64bit compiled code. It seems like...
2
3526
by: not_a_commie | last post by:
I've been using INPUT as declared below. However, I get warnings about this being incompatible with a 64bit OS. I have no 64bit OS to test on. However, is it true that the union in the INPUT declaration below would need to line on an 8byte boundary for a 64bit OS? And should I just do this with #if? #if 64bitosblah FieldOffset(8) #else FieldOffset(4)? public static extern uint SendInput(uint nInputs, INPUT pInputs, int cbSize);
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.