Author Topic: Binary size reduction - UPX  (Read 18162 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Binary size reduction - UPX
« Reply #15 on: October 16, 2005, 03:31:08 pm »
Sorry, but I cannot agree with Muhammad: The best C/C++ compiler for Windows is Intel C++.

It's a shame it needs the libraries, headers and some programs of Visual C++ to work, but it's The One :)

takeshimiya

  • Guest
Re: Binary size reduction - UPX
« Reply #16 on: October 16, 2005, 04:42:30 pm »
I disagree with both. :lol:

There isn't anything like THE compiler (at least for now). Every compiler have his own pros and cons.
A rough guide of the current most used compilers would be:

MSVC 7
-Binary size: Smallest
-Compilation time: Very good
-Speed of execution: Very good
-Platform: Windows

GCC 3
-Binary size: Biggest
-Compilation time: The worst
-Speed of execution: Very good
-Platform: Everywhere

DMars 8
-Binary size: Good
-Compilation time: The best
-Speed of execution: Average
-Platform: Windows

Intel 8
-Binary size: Big
-Compilation time: Slow
-Speed of execution: The best
-Platform: Windows, Linux

OpenWatcom 1.1
-Binary size: Good
-Compilation time: Average
-Speed of execution: Slowest
-Platform: Windows, OS/2

Borland 5.5
-Binary size: Average
-Compilation time: Very good
-Speed of execution: Very good
-Platform: Windows

Hence, a choice could be: DMars while developing, MSVC for win32 release, GCC for everything else.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Binary size reduction - UPX
« Reply #17 on: October 17, 2005, 01:16:11 am »
Don't forget that Intel compiled executables are slower when run in AMD processors.
http://www.theinquirer.net/?article=24574

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Binary size reduction - UPX
« Reply #18 on: October 17, 2005, 01:48:24 am »
Hmmm, that article is related to a problem already fixed in the Intel Fortran compiler.

A few years ago I was helping test some code with the Intel C++ compiler vs GNU G++ and the tests ran in an AMD machine.

In fact the generated code was pretty good and he hadn't any problems running it.

It's true Intel compilers are optimized for Intel processors and technologies (I think the reason is obvious) but compiling with the right flags the executables will run just fine in both Intel and AMD processors.

BTW, there's an article around about GCC vs Intel C++. It measures performance, compilation time and executable size. It shows that both Intel C++ and GCC are pretty good competitors, but it also shows that in some cases Intel C++ generates much better code.

Oh, and we're going off-topic again, don't we?

takeshimiya

  • Guest
Re: Binary size reduction - UPX
« Reply #19 on: October 17, 2005, 04:04:58 pm »
Yep, just to note that there are some hacks to disable the "if it's an AMD CPU then I'll unoptimize the code" check.
You had to #define something, and that's all to disable the lame check.

Anyways, AMD bring out Intel to the court regarding this, so it's possible that new versions of the compiler will not include the lame check.

The funny part, it's that even with those unoptimizations, on an AMD CPU, the compiler is in most benchmarks better than GCC or MSVC (regarding speed of execution).

But I think that the Intel Compiler isn't very helpful for compiling C::B, as it would provide only an advantage regarding speed.

I still think that a good approach is:
DMars while developing for it's amazing compilation time,
MSVC for win32 release for it's amazing binary size, and
GCC for everything else for it's amazing availability everywhere. :)
« Last Edit: October 17, 2005, 04:10:38 pm by takeshimiya »

Ptomaine

  • Guest
Re: Binary size reduction - UPX
« Reply #20 on: November 14, 2005, 03:57:08 pm »
BTW, Apple has chosen the Intel C++ compiler as the default compiler for their MacOSX for the Intel platforms. The release date is late March or so.
So, you have to correct the item like:

Intel 9.x
-Binary size: Big
-Compilation time: Slow
-Speed of execution: The best
-Platform: Windows, Linux, Mac OSX

P.S. The Intel C++ compiler is the only compiler that can produce optimized code for two types of processors and switch to optimized code run-time!