www.digitalmars.com         C & C++   DMDScript  

c++ - horrible optimizer performance

reply "copx" <copx gazeta.pl> writes:
It seems the optimizer of Digital Mars is horribly out of date. 
I just tested it with some code, and it performs worse than even 
the non-commercial, one-man project Pelles C or lccwin32.

The generated code is 100% (!) slower than the code generated 
by GCC, and as I said even a little slower than the code produced
by those part-time compilers.

I am kinda surprised, considering DM's commercial roots, I 
expected it to perform at a level somewhere between Pelles C
and GCC.

Or maybe I am just using the wrong flags? This is my first
attempt to compile something with this compiler, so maybe
that's the case. I am trying to build a C (not C++) Win32 
console application here, P5 instruction set, and I use:

dmc -5 -o+all demo.c grid.c

demo.c and grid.c are the two files which contain the
source code.

It works fine, except for the horrible performance..
Feb 01 2011
parent reply Cesar Rabak <crabak acm.org> writes:
Em 1/2/2011 23:16, copx escreveu:
 It seems the optimizer of Digital Mars is horribly out of date. I just
 tested it with some code, and it performs worse than even the
 non-commercial, one-man project Pelles C or lccwin32.

 The generated code is 100% (!) slower than the code generated by GCC,
 and as I said even a little slower than the code produced
 by those part-time compilers.

 I am kinda surprised, considering DM's commercial roots, I expected it
 to perform at a level somewhere between Pelles C
 and GCC.

 Or maybe I am just using the wrong flags? This is my first
 attempt to compile something with this compiler, so maybe
 that's the case. I am trying to build a C (not C++) Win32 console
 application here, P5 instruction set, and I use:

 dmc -5 -o+all demo.c grid.c

 demo.c and grid.c are the two files which contain the
 source code.

 It works fine, except for the horrible performance..
Without specific information this post does not bring any chance to receive an answer which will be helpful be it for you or the groups of users of DM compiler. Please send a link to a place where 'demo.c' and 'grid.c' could be downloaded. If the sources are not possible to be disclosed, then find an example of a public available source that in your opinion demonstrates clearly the problem[s] you're complaining. Without data its is not possible any diagnostic.
Feb 02 2011
parent reply "copx" <copx gazeta.pl> writes:
"Cesar Rabak"  wrote in message news:iiceg8$21m8$1 digitalmars.com... 
[snip remark about poor optimizer performance]
 dmc -5 -o+all demo.c grid.c

 demo.c and grid.c are the two files which contain the
 source code.

 It works fine, except for the horrible performance..
Without specific information this post does not bring any chance to receive an answer which will be helpful be it for you or the groups of users of DM compiler.
The original post probably was a little unclear because it mixed my surprise about the poor optimizer performance with my actual question. I basically just want to know how to make dmc produce fully optimized binaries. According to the command line help and what little documentation is available for free at the DM website the above command line seems correct. I am just asking here to make sure that I did not miss some vital flag. The optimizer performance is what it is.
Feb 02 2011
parent reply Cesar Rabak <crabak acm.org> writes:
Em 2/2/2011 18:51, copx escreveu:
 "Cesar Rabak" wrote in message news:iiceg8$21m8$1 digitalmars.com...
 [snip remark about poor optimizer performance]
 dmc -5 -o+all demo.c grid.c
BTW, where did you find the flag "+all" in the optimization switch?
 demo.c and grid.c are the two files which contain the
 source code.

 It works fine, except for the horrible performance..
Without specific information this post does not bring any chance to receive an answer which will be helpful be it for you or the groups of users of DM compiler.
The original post probably was a little unclear because it mixed my surprise about the poor optimizer performance with my actual question.
Indeed. The problem is that you insist in this approach:
 I basically just want to know how to make dmc produce
 fully optimized binaries.
Which would be what? You know, "fully optimized" is as informative as "horrible performance". You need to inform what are the attributes you're after in your program so the right set of actions can taken to achieve a goal.
 According to the command line help
 and what little documentation is available for free at the DM
 website the above command line seems correct.
There is no way to insure it is correct or no, without knowing your requirements and the nature of the source code.
 I am just
 asking here to make sure that I did not miss some vital flag. The
 optimizer performance is what it is.
The flags are vital or not accordingly to goals for the compiled code, which you insist in not sharing, so it is impossible to determine that. The only way we can assess your complaints is understanding the issue[s]. To do so we need to see them.
Feb 02 2011
parent reply "copx" <copx gazeta.pl> writes:
"Cesar Rabak"  wrote in message news:iicicl$29h2$1 digitalmars.com... 
BTW, where did you find the flag "+all" in the optimization switch?
http://www.digitalmars.com/ctg/ctgOptimizer.html Quote: "Use +all to optimize your code to the fullest extent. "
Indeed.  The problem is that you insist in this approach:
I think the issue is that you are either an idiot or an asshole.
 I basically just want to know how to make dmc produce
 fully optimized binaries.
Which would be what? You know, "fully optimized" is as informative as "horrible performance".
See above. Either you are amazingly stupid or you are just pretending to misunderstand to waste my time. The meaning of phrases and words in human communication depends on context. My first post made it absolutely clear that I am talking about optimizing for speed here. Notice the "slower than" as opposed to "bigger than". "Fully optimized" in this context thus can only mean the correct flags for "optimize for speed" builds. Notice that even the Digital Mars website I quoted uses the "non-informative" expression "to optimize your code to the fullest extent." which is just a more verbose form of "to fully optimize your code". That they are talking about fully optimized for speed here becomes clear only if you look at the context. Which is no problem provided the reader isn't you. I am not going to waste further time with you.
Feb 02 2011
parent Cesar Rabak <crabak acm.org> writes:
Em 2/2/2011 20:56, copx escreveu:
 "Cesar Rabak" wrote in message news:iicicl$29h2$1 digitalmars.com...
 BTW, where did you find the flag "+all" in the optimization
 switch?
http://www.digitalmars.com/ctg/ctgOptimizer.html Quote: "Use +all to optimize your code to the fullest extent. "
 Indeed. The problem is that you insist in this approach:
I think the issue is that you are either an idiot or an asshole.
Let me give you an important clue: insulting me will not magically solve the problems of yours. You insist in not explaining the problem, and only gets annoyingly repetitive in keeping in the route on non helping others to help you. Now, you broke another barrier and went rude.
 I basically just want to know how to make dmc produce fully
 optimized binaries.
Which would be what? You know, "fully optimized" is as informative as "horrible performance".
See above. Either you are amazingly stupid or you are just pretending to misunderstand to waste my time.
You are wasting the time of anyone who decides to pay attention to this thread.
 The meaning of phrases and words in human communication depends on
 context.
Which you systematically refuse to give. Right?
 My first post made it absolutely clear that I am talking about
 optimizing for speed here.
Speed of what? How did you measure it? Where is a code sample so we can look at and see if the sample warrants your conclusions? If the specific code is some pathologic case or is triggering a behaviour in the toolchain which brings the results you see, but no one else can see!?
 Notice the "slower than" as opposed to "bigger than".
Ok. Exact figures? Platform?
 "Fully optimized" in this context thus can only mean the correct
 flags for "optimize for speed" builds.
No, it can mean anything until the exact meaning gets understood by all the parties involved in the dialogue.
 Notice that even the Digital Mars website I quoted uses the
 "non-informative" expression "to optimize your code to the fullest
 extent." which is just a more verbose form of "to fully optimize your
 code". That they are talking about fully optimized for speed here
 becomes clear only if you look at the context. Which is no problem
 provided the reader isn't you.
The context provided by the web page you referenced is more complete as the "full extent" is adequately described in the page as an alias for a set of optimization techniques.
 I am not going to waste further time with you.
Without giving enough information on your problem is a waste of your time to post just complaining and dodging to inform minimally how to reproduce your problem. wygłupiać się z narzędziem, jest jeszcze głupia ...
Feb 02 2011