Author Topic: Program bloat and compile speed questions.  (Read 7265 times)

Mr. Guest

  • Guest
Program bloat and compile speed questions.
« on: April 21, 2005, 03:52:37 pm »
OK I just switched from Dev-C++ 4(with Mingw 2.95) to the latest CB build a few days ago and I've got a few questions.

1) With Dev-C++ my current project was 230k but now is at 710k. Is there any way to un-bloat it without a exe-compressor.

2) In Dev-C++ it took about 30-40 seconds to compile but CB has added about a minute on to that. Any way to change this?

I realize it has nothing to do with the IDE, it's all the compiler. I'm just thinking there's some options I have to turn on that Dev-C++ has enabled by default. I don't have any build options on right now, I tried optimizing but that  caused my program to crash.

I can sort of live with the bloat, but the compile time thing is making me crazy. Thanks for any replies.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Program bloat and compile speed questions.
« Reply #1 on: April 21, 2005, 05:40:14 pm »
Quote
1) With Dev-C++ my current project was 230k but now is at 710k. Is there any way to un-bloat it without a exe-compressor.

Try "strip your.exe". This will strip unnecessary symbols from it. You can also compress it with upx if you need.

Quote
2) In Dev-C++ it took about 30-40 seconds to compile but CB has added about a minute on to that. Any way to change this?

I don't think so... You see, gcc-3.x is slower then 2.95 and there is nothing we can do about it. Only the gcc developers could change it, although I believe there are plenty good reasons why it's slower now, like better ANSI compliance etc.
You could, though, use Code::Blocks with your old compiler, gcc-2.95 ;)

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Program bloat and compile speed questions.
« Reply #2 on: April 21, 2005, 08:25:07 pm »
OK thanks. I finally figured out how to use strip and now it's at 390k.

Mabye I should upgrade from 64mb ram if I want it to move faster :)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Program bloat and compile speed questions.
« Reply #3 on: April 21, 2005, 09:26:06 pm »
Don't forget that UPX can also compress your exe _AND_ dll's! (In fact I'm still waiting for the option to run post-build commands on the compiled executable).

Offline heaveny38

  • Single posting newcomer
  • *
  • Posts: 3
Program bloat and compile speed questions.
« Reply #4 on: May 25, 2005, 09:03:41 pm »
I'm new to this forum and I am currently switching from DevCpp to code::blocks too.

I am experiencing the same problem. Except turning on exe stripping doesn't bring back the size I was getting with DevCpp. And I was using DevCpp with the same version of the compiler too.

With devcpp I was getting something around 110kbytes with stripping enabled. With Codeblocks, I am getting around 360kbytes with strpiping enabled (added -s in linker options).

What is going on?

With MingW developer studio, the exe is even smaller, same compiler, what are the hidden options, or the ones that are not in the list taht could cuase that?

Thanks.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Program bloat and compile speed questions.
« Reply #5 on: May 25, 2005, 09:38:32 pm »
Code: [Select]
#include <iostream>

int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}

Result: 282,624 bytes

Code: [Select]

#include <stdio.h>
#include <stdlib.h>

int main()
{
printf("Hello world!\n");
return 0;
}

Result: 5,632 bytes

As you can see, it really depends on the libraries used...

Yiannis.
Be patient!
This bug will be fixed soon...

Offline heaveny38

  • Single posting newcomer
  • *
  • Posts: 3
Program bloat and compile speed questions.
« Reply #6 on: May 25, 2005, 11:47:10 pm »
Yeah, I know, but this big code size difference happens only with my code, not when only using standard libraries. It's weird.

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Program bloat and compile speed questions.
« Reply #7 on: May 26, 2005, 12:54:18 am »
Can you post your source here?
I bet some people would enjoy playing with compiler switches... :)
this space is for rent

Offline heaveny38

  • Single posting newcomer
  • *
  • Posts: 3
Program bloat and compile speed questions.
« Reply #8 on: May 26, 2005, 08:42:20 pm »
Well, it's about 300k of source files, it'S a library that I was working on to learn more about true C++ and templates. I guess I can't post it as a source block in the forum heh ;) Is there any other way? As I plan to drop it, there's no secret in there :)

EDIT:

The thing is, even when doing nothing, the exe is huge, meaning that a lot of stuff gets inside it even when not using it. Adding code in main.cpp hardly changes the size. It's as if everything was getting linked even though it wasn't used.

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Program bloat and compile speed questions.
« Reply #9 on: May 26, 2005, 10:27:10 pm »
Quote
The thing is, even when doing nothing, the exe is huge, meaning that a lot of stuff gets inside it even when not using it. Adding code in main.cpp hardly changes the size. It's as if everything was getting linked even though it wasn't used.

No matter what is happening, it should be possible to make it at least same size as it is in Dev-C++ (if MinGW versions are the same).

You can send it to: squizzz (at) gmail.com. I could take a look in my spare time. Anyone else? :D
this space is for rent

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Program bloat and compile speed questions.
« Reply #10 on: June 09, 2005, 07:06:02 pm »
Hmmm...?

int main(int argc, char *argv[])
{
return 0;
}

Dev-CPP 4.9.9.2               ---> 5632 Bytes
code::blocks 1.0finalBeta    ---> 5632 bytes

Both are stripped executable sizes, compiler switches whatever the respective IDE comes with as default.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Program bloat and compile speed questions.
« Reply #11 on: June 09, 2005, 07:08:56 pm »
that is probably mingw/gcc...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring