Author Topic: C::B with DM or vc++?  (Read 17430 times)

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
C::B with DM or vc++?
« on: February 22, 2006, 01:51:41 pm »
I've done several test with wxwidgets and other libs (f.e. antigrain) to test compiler performances. It seems that gcc it's slow to compile, make big exes and they are poorly optimized. For example on antigrain benchmark gcc is 4/5 times slower than dmc and vc++... I know you use mingw to improve performace, but i wonder if anyone have tried to compile it with other compilers...
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #1 on: February 22, 2006, 01:59:33 pm »
It seems that gcc it's slow to compile, make big exes and they are poorly optimized.
Yes to first (but it's improved a lot with GCC4), yes to second (but only win32, MinGW32 linker's fault), and the third, YMMV.

I know you use mingw to improve performace, but i wonder if anyone have tried to compile it with other compilers...
AFAIK it's not used to improve performance, it's used because it's the most common and portable opensource compiler.

i wonder if anyone have tried to compile it with other compilers...
Yes, Sam got it working with MSVC, but I don't know if he made patches or if the patches are applied on SVN.
I don't know about DMars, but if any errors, it's most probably because DLLEXPORT and those kind of things.


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: C::B with DM or vc++?
« Reply #2 on: February 22, 2006, 02:04:41 pm »
I know you use mingw to improve performace, but i wonder if anyone have tried to compile it with other compilers...

AFAIK some people have tried. The results, I don't know.
But even if it could succesfully build in other compilers, we 'd still use GCC. This will never change, no matter what.
Here are the reasons:

  • C::B is cross-platform and the only reliable cross-platform compiler available is GCC.
  • I don't have MSVS nor have I ever used/seen it. I don't plan to change this now.
  • The above point makes clear that even if someone contributed a patch for other compilers to build C::B, it wouldn't be accepted because we couldn't maintain it (been there, done that).

With that said, you should really learn how to use the available optimization options for GCC. GCC generated executables are not slower than MSVS's nor DM's.

Quote
antigrain benchmark gcc is 4/5 times slower

I 'd like to see some facts please.
I can tell you it's 3 times faster but if I don't show you the facts, it's not worth anything...
Be patient!
This bug will be fixed soon...

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #3 on: February 22, 2006, 02:30:47 pm »
Trikko: C::B is buildable with other compilers like MSVC. But it will never be distributed as is in official builds.

It will happen like Firefox development: The official builds are always built with GCC, and Unofficial, Nightly builds are most of times built with MSVC2005, or other compilers, often for optimization purposes.

Sam got C::B compiling on MSVC here: http://forums.codeblocks.org/index.php?topic=2085.0

Hope that answer your questions.

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #4 on: February 22, 2006, 07:42:36 pm »
bauhauah what an idiot i am... i mean "to improve portability" (becase gcc is the same compiler on many platform) :D
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline grunerite

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: C::B with DM or vc++?
« Reply #5 on: February 22, 2006, 08:05:03 pm »
GCC generated executables are not slower than MSVS's nor DM's.
Hey,

I've been looking for some good #'s that show this. I tend to agree with you, at least at face value I see no difference in execution speed, responsiveness to resizing windows of apps, etc. But, I'd like to find some real data that shows this, to convince some others this is the case.

Do you have any references for this statement, because I can't find any good test comparisons?
Cheers

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #6 on: February 22, 2006, 08:14:49 pm »
I 'd like to see some facts please.
I can tell you it's 3 times faster but if I don't show you the facts, it's not worth anything...

About compile time: try to compile wxWidgets.
About performance and antigrain. I was referring to an example included with antigrain distro.
It's a simple benchmark with some performance value about drawing line points ecc, not really a good one for a compiler, but it could give you an idea. On my machine f.e. first value is 60k/s (points) for digital mars, 40/s for visual c++ and 10kb/s (!) for mingw. I have no more mingw installed so i can't compile it but i remember the value... (and i have a bug with C::B that tells me it can't found mingw-g++ ...) If you don't trust me, you can do some test by yourself.

I tried it also with many other example, with my simple wxapp difference is small, but in some case you can taste it (usually in frame loading time and complex operations...). I think that in codeblocks this difference could be bigger.

By the way it's just an opinion. Maybe i'm wrong about it.  In this case don't worry and go on compiling this fantastic ide with mingw! :)

A. Fontana
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #7 on: February 22, 2006, 09:05:10 pm »
Do you have any references for this statement, because I can't find any good test comparisons?

An example is the fact that all windows unofficial builders of Firefox uses MSVC compiler. I can say that those unofficial builds makes Firefox a lot faster, and there are benchmarks about it (JavaScript benchs, loading of images, etc). The app feels a lot more responsive also.

But I think we shouldn't start a compiler1 vs. compiler2 thing.

I think the only real truth is that no one compiler is overall better than other. Each one haves their own strenghts.
Nothing stops you to use more than one, and experience tells that it leads to more better and portable code (some compilers don't bail out, were others does).

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #8 on: February 22, 2006, 10:02:24 pm »
For example i think it could be useful for codecompletition that takes a lot to parse all wxWidgets classes... (but it's really useful).

About CodeCompletition i have a simil bug report. When popup tips window appear Managment pane, Open file list pane, menu bar, status bar and icons on toolbar blink... Message pane and main tabbed window does not. Is it possible to correct these blinks/flicks?

A. Fontana
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline NeXuS

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B with DM or vc++?
« Reply #9 on: February 23, 2006, 01:36:53 pm »
I've done several test with wxwidgets and other libs (f.e. antigrain) to test compiler performances. It seems that gcc it's slow to compile, make big exes and they are poorly optimized. For example on antigrain benchmark gcc is 4/5 times slower than dmc and vc++... I know you use mingw to improve performace, but i wonder if anyone have tried to compile it with other compilers...

In my very humble opinion and to my experience only the statement on file sieze is true.
I am currently using both VS 2006 and Codeblocks with mingw:
- Compile times are faster with mingw than MS compiler (it's just my feeling, I don't have exact times for MS compiler but I think it's kind of slower
- Execution times, when code is compiled with proper optimizations, it almost the same. Depending on the instruction mix sometimes mingw produces faster code, other times MS compiler works better.
- Executables are indeed a little bit fatter when produced with mingw


This is just my two euro cents of wisdom.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B with DM or vc++?
« Reply #10 on: February 23, 2006, 03:03:53 pm »
This is just my two euro cents of wisdom.
And it's perfectly true :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #11 on: February 23, 2006, 04:48:33 pm »
http://www.osnews.com/img/5602/results.jpg  <-- watch this benchmark about math
http://biolpc22.york.ac.uk/wx/wxhatch/wxMSW_Compiler_choice.html <-- a quite old test with wxwidgets

There are many other example. You can try it by yourself... Where can i find an unofficial vc or dm build of C::B? :)
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #12 on: February 23, 2006, 04:59:42 pm »
http://biolpc22.york.ac.uk/wx/wxhatch/wxMSW_Compiler_choice.html <-- a quite old test with wxwidgets
I have to say that those wxWidgets benchmarks are true, I've tested myself, and DMars is 20x times faster than GCC3 in compilation time. YMMV.
As a note, DMars linker is purely written in assembler, and the compiler got lot's of parts also.

It would be good to benchmark GCC4 too, as for sure it comes closer with the new AST optimizations.

There are many other example. You can try it by yourself... Where can i find an unofficial vc or dm build of C::B? :)

Ask Sam, as I've said above, he got it compiling :D
« Last Edit: February 23, 2006, 05:04:40 pm by Takeshi Miya »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: C::B with DM or vc++?
« Reply #13 on: February 23, 2006, 05:05:57 pm »
http://www.osnews.com/img/5602/results.jpg  <-- watch this benchmark about math
http://biolpc22.york.ac.uk/wx/wxhatch/wxMSW_Compiler_choice.html <-- a quite old test with wxwidgets

The GCC used is old. Now we are quite (or already) at GCC 4.1.0. The benchmarks should be re-done :D.

Anyway, have a look at here.

There are many other example. You can try it by yourself... Where can i find an unofficial vc or dm build of C::B? :)

I am not sure that such unofficial builds of C::B exists. May be as Takeshi Miya said, Sam has done one. You can always try to build SVN sources by yourself and share your results :).

Best wishes,
Michael

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #14 on: February 23, 2006, 05:07:29 pm »

Ask Sam, as I've said above, he got it compiling :D


Where is he? Give me his homepage! :D

Source from svn does not compile with other compilers... they need a patch... It could be useful to compile it with more compilers: in this way code become more "portable" :)

A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #15 on: February 23, 2006, 05:13:44 pm »
It's here: http://forums.codeblocks.org/index.php?topic=2085.0

C::B has been compiled with MSVC and Intel compilers with few one-time changes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5215
Re: C::B with DM or vc++?
« Reply #16 on: February 23, 2006, 05:14:59 pm »
My personal opinion :
- OFFICIAL CB is compiled with GCC and reamins that way ( see  remarks of Yiannis)
- let's try to help the people who try to build CB with other compilers (other mostly true warnings/ errors) --> always good to compile with everal compilers
- if people see a more 'optimized' build of CB can be obtained by using another compiler they can build it themselves (they just get the sources and make it themselves), choice is a good thing, but maintaining CB distributions with different compilers is a bit to much for the CB team, but every user can then however create on his/her self.
Note don't focus too much on the build time of CB itself only ( I rather compile it with a slow compiler to have in the end a fast CB application, then have it compile super quick and ending up with a slow CB)

Good luck with this further research, very interesting !!!

Cheers,
Lieven

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #17 on: February 23, 2006, 05:17:19 pm »
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #18 on: February 23, 2006, 05:21:20 pm »
It's here: http://forums.codeblocks.org/index.php?topic=2085.0

C::B has been compiled with MSVC and Intel compilers with few one-time changes.

Why didn't C::B developer apply this patches to official distro?
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #19 on: February 23, 2006, 05:26:15 pm »
Why didn't C::B developer apply this patches to official distro?

I think Sam didn't posted the patches on the tracker. :)

I agree with Lieven here.

sethjackson

  • Guest
Re: C::B with DM or vc++?
« Reply #20 on: February 23, 2006, 05:39:05 pm »

Anyway, have a look at here.


DM passes 100% of dr. dobbs tests :D

http://www.digitalmars.com/changelog.html#new845

ehehhehe :)


Umm DM isn't on the list (show me where I can't find it) and guess what that was done in November 2003. The GCC proposed candidate passed  99.11%, and the test (what they testing I can't even tell) was done 2 years ago.  :P Hmm I think GCC is waaaay better now.....

EDIT:

Oh and BTW the proposed GCC candidate passed more of the "test" than M$ VC......  :lol:

Have a look here like Michael said.

http://cmeerw.org/prog/freecpp/
« Last Edit: February 23, 2006, 05:41:55 pm by sethjackson »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B with DM or vc++?
« Reply #21 on: February 23, 2006, 05:40:04 pm »
Nobody doubts that DM compiles a lot faster.
However, as far as those benchmarks are concerned, those are simply hilarious. The floating point math comparison even more than the wxWidgets one.

Why didn't C::B developer apply this patches to official distro?
I think Sam didn't posted the patches on the tracker. :)
I agree with Lieven here.
It does not matter whether he did or not. Those patches will not be applied.

Nevertheless, if you believe that you have to compile using MSVC, then feel free to do that. However, if you get strange errors like Sam is getting, then don't come here and complain... :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: C::B with DM or vc++?
« Reply #22 on: February 23, 2006, 05:43:51 pm »

Anyway, have a look at here.

DM passes 100% of dr. dobbs tests :D

http://www.digitalmars.com/changelog.html#new845

ehehhehe :)

The GCC version I have tested at that time (3.4.4) passed 2 or 3 more tests :wink:. Imagine version 4.1...... :D

Anyway, I do n ot want to begin a compiler's war :D.

Best wishes,
Michael

sethjackson

  • Guest
Re: C::B with DM or vc++?
« Reply #23 on: February 23, 2006, 05:47:51 pm »
The GCC version I have tested at that time (3.4.4) passed 2 or 3 more tests :wink:. Imagine version 4.1...... :D

Anyway, I do n ot want to begin a compiler's war :D.

Best wishes,
Michael

We have almost have a few already (in other threads) I think......  :lol: It is always funny how people compare new compilers to an old version of GCC......

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #24 on: February 23, 2006, 06:05:41 pm »
Imagine version 4.1...... :D
4.1 haves lot's of regressions on Win32, so it's quite the opossite for now.

I think Sam didn't posted the patches on the tracker. :)
I agree with Lieven here.
It does not matter whether he did or not. Those patches will not be applied.

It's quite the opossite, what matters is that patches aren't deleted on the tracker, so other people that is interested in doing so can do it by applying them. If they're applied to codebase or not, it's just a matter of convenience to official builds.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B with DM or vc++?
« Reply #25 on: February 23, 2006, 06:07:11 pm »
It is always funny how people compare new compilers to an old version of GCC......
I'd not call it funny. It is actually quite embarassing.
Imagine you compared a 1950 car to a 2005 car. Everybody would yell "bloody fool" at you... :lol:

It gets even more embarassing when things like floating point throughput are taken as a measure to compare compilers in terms of application performance. Unless you write something like a realtime MP3 encoder, this is absolutely irrelevant to you (and in that case, you would code the SSE stuff by hand, anyway).
A typical, "normal" GUI application is idle 95%-98% of the time, and it rarely ever uses a floating point operation at all.

The one and only thing that really uses significant CPU in Code::Blocks is the code completion plugin, and that is due to a somewhat unlucky parsing algorithm, not due to compiler-related issues.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #26 on: February 23, 2006, 06:13:45 pm »
I think that discussing that one compiler or language is better than other, in an IDE that haves multi-compiler multi-language support, is only going to hurt.
« Last Edit: February 23, 2006, 06:17:26 pm by Takeshi Miya »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: C::B with DM or vc++?
« Reply #27 on: February 23, 2006, 06:21:41 pm »
I think that discussing that one compiler or language is better than other, in an IDE that haves multi-compiler support, is only going to hurt.

Yes, you are right. It can cause problems. Anyway, IMHO the discussion could be divided into two parts: (1) the compiler used to build C::B and (2) the compiler used to build your application. For example, I like GCC and I hate M$ compiler. If C::B were built with M$, what I will do...:D....Well, I think that I will used it anyway, but building my applications with GCC :).

Best wishes,
Michael

Offline Trikko

  • Multiple posting newcomer
  • *
  • Posts: 82
    • e-nuts.net
Re: C::B with DM or vc++?
« Reply #28 on: February 23, 2006, 06:25:06 pm »
Nobody doubts that DM compiles a lot faster.
However, as far as those benchmarks are concerned, those are simply hilarious. The floating point math comparison even more than the wxWidgets one.

I've just underlined that i was speaking about math... :D
A. Fontana
My homepage
Do you need custom software? Do you want to work as freelancer?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: C::B with DM or vc++?
« Reply #29 on: February 23, 2006, 06:54:58 pm »
I think Sam didn't posted the patches on the tracker. :)
I agree with Lieven here.
It does not matter whether he did or not. Those patches will not be applied.

It's quite the opossite, what matters is that patches aren't deleted on the tracker, so other people that is interested in doing so can do it by applying them. If they're applied to codebase or not, it's just a matter of convenience to official builds.

Thomas said what I said a few posts up: patches for supporting builds with other compilers will not be accepted.

BUT

The fact that we may reject the patch, does not mean that it is deleted from the patch tracker. The patch will always be there for anyone to try and apply, if he/she needs to. You just have to filter for "Any" patch, instead of "Open" ones ;)
Be patient!
This bug will be fixed soon...

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: C::B with DM or vc++?
« Reply #30 on: February 23, 2006, 07:33:31 pm »
The fact that we may reject the patch, does not mean that it is deleted from the patch tracker. The patch will always be there for anyone to try and apply, if he/she needs to.

Good to hear :D, because other projects deletes them permanently and without further notice.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: C::B with DM or vc++?
« Reply #31 on: February 24, 2006, 12:46:53 am »

Anyway, have a look at here.


DM passes 100% of dr. dobbs tests :D

http://www.digitalmars.com/changelog.html#new845

ehehhehe :)


Umm DM isn't on the list (show me where I can't find it)

Yes, true :). I cannot see DM on the list. Where is it?

Best wishes,
Michael

Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: C::B with DM or vc++?
« Reply #32 on: February 27, 2006, 05:34:10 pm »
Update the Windows SDK at http://cmeerw.org/prog/dm/ms_sdk.html and you'll find that DMC does not compile substantially faster than the others.

Offline Ivan Kolev

  • Multiple posting newcomer
  • *
  • Posts: 20
    • Home page
Re: C::B with DM or vc++?
« Reply #33 on: March 12, 2006, 03:06:06 pm »
But even if it could succesfully build in other compilers, we 'd still use GCC. This will never change, no matter what.
Here are the reasons:

  • C::B is cross-platform and the only reliable cross-platform compiler available is GCC.
  • I don't have MSVS nor have I ever used/seen it. I don't plan to change this now.
  • The above point makes clear that even if someone contributed a patch for other compilers to build C::B, it wouldn't be accepted because we couldn't maintain it (been there, done that).


This is understood. I'd like to add some other points though:

- Most compiling problems under VC are related to the mentioned

Code: [Select]
_("some text"
"some more text")

which needs to become

Code: [Select]
_("some text")
_("some more text")

These could be easily fixed in the SVN trunk and avoided in the future, without any need for maintenance. While it won't solve VC-compatibility completely, it would reduce the size of a possible external patch.

- Having additional compiler support in external patches instead of the main codebase is a good idea, but AFAIK such patches are made against a specific SVN revision, so the maintainers of such patches would need to release a new patch for each new revision, or at least for the major ones (I'm not sure about this, I might be wrong).

- Maintaining additional compilers would surely take precious time of the CB team, so it's out of the question. But you might want to check out the Express version of Visual Studio 2005 which IIRC is free. I think the CB team could only benefit from knowing better the major C++ IDE on the market, at least for the fact that many future users of C::B with VS experience will often ask questions like "why doesn't C::B have this feature which VS has...".

- As killerbot mentioned, building with different compilers usually helps find problems and improves code quality. VC 2005 for example has an option for "C++ analysis", which issues a lot of additional warnings for possible problems (e.g. using pointers without checking if they are 0). But I'm not sure if this option is available in VS Express.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B with DM or vc++?
« Reply #34 on: March 12, 2006, 03:25:44 pm »
Most compiling problems under VC are related to the mentioned
Code: [Select]
_("some text"
"some more text")

which needs to become

Code: [Select]
_("some text")
_("some more text")
Why do these need to be changed? It is perfectly correct to continue a character constant in the next line, be it in a macro argument or not. The code is absolutely valid, it is the MS compiler which does not work properly.

Quote
Having additional compiler support in external patches instead of the main codebase is a good idea, but AFAIK such patches are made against [...] would need to release a new patch for each new revision
That is partially true at the present time, only very radical SDK changes will require that.
It is however one reason why I keep telling people "don't do this and don't do that right now", because this will change radically in the near future.

Quote
VC 2005 for example has an option for "C++ analysis", which issues a lot of additional warnings for possible problems [...]
To be honest, gcc is already quite pedantic if you turn on all warnings. Personally, I don't think that there are many MS products which are really apt to improve code. DM or Comeau may of course be an entirely different story, but the additional workload would be quite substantial.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Ivan Kolev

  • Multiple posting newcomer
  • *
  • Posts: 20
    • Home page
Re: C::B with DM or vc++?
« Reply #35 on: March 12, 2006, 05:40:34 pm »
Why do these need to be changed? It is perfectly correct to continue a character constant in the next line, be it in a macro argument or not. The code is absolutely valid, it is the MS compiler which does not work properly.

Indeed. Besides, I suggested the wrong change. To make the example work in VC, it has to be

Code: [Select]
_("some text\
some more text")