On Wed, 27 May 2009, Mindaugas Kavaliauskas wrote:
> I see a few new features under GCC: hbvmall, I see a new discussions about 
> HB_STRICT_ALIGNMENT, etc. So, I decided to do some new speed tests BCC vs 
> GCC. BCC was winning long time ago (before dlmalloc).
> Test conditions:
> - SVN 11150
> - WinXP SP2
> - default build + -DHB_FM_STATISTICS_OFF
> - speedtest.exe
>                        BCC          MinGW 4.4.0
> Test execution    69.58 / 73.90    57.77 / 59.98
> speedtst.exe size    622592     1090648 (903680 stripped)
> Harbour build       4min 47sec      29min 15sec
> So, GCC is 17% faster execution, 45% larger executable, 6.11 times longer 
> compilation.

Interesting. I've just make Harbour BCC5.5 and MinGW-GCC3.4.5 builds in my
Linux box. BCC was executed using WINE, MinGW as native Linux binaries
for cross compilation. I'm using:
   export HB_USER_PRGFLAGS="-gc2"
to reduce the compilation time (-gc3 strongly increase the time).
The build time with -j5 (I have 3 CPU machine) make parameters:
   1) BCC:
         real     2m54.801s
         user     1m51.423s
         sys      1m23.957s
   2) MinGW:
         real     1m13.781s
         user     2m49.843s
         sys      0m15.293s

here it's hard to compare results because BCC is windows application
executed by WINE and MinGW native Linux ones.
But then I created windows binaries of speedtst.exe for both compilers
also compiled with -gc2:
   1) BCC:
         size:    600576
         execution time:      33.38 / 33.60
   2) MinGW:
         size:    882688 (striped)
         execution time:      21.99 / 22.15

So BCC gives ~50 worse results.
Interesting that in your case the difference is smaller.
If it's possible and you agree I would like to send you my binaries
so we can compare results in real windows also with your previous
ones from MinGW-GCC4.4.0 builds.

> The question is: why executable size is significantly larger? Huge number 
> of inlined functions or ...?

Inlined code but also different C RTL and machine code which is not
optimized for size but for speed with the cost of size and does not
use some of CPU flags used by BCC (f.e. carry flag).
I've just rebuild Harbour using MinGW with:
   export HB_USER_CFLAGS="-Os"
and the results are:
         size:    496640 (striped)
         execution time:      35.23 / 35.40
so the size of speedtst.exe is smaller then in BCC builds but also ~5.5%
slower.

> For Harbour development, it would be nice to have a better compile time 
> also. Half an hour to check if typo is fixed is a long time.

See my results. They are quite sufficient for me. But I'm using -gc2
for .prg code. Please also remember that the time strongly depends on
number of compiled contrib and external libraries.
If you want to compile only core code then you can use:
   export HB_EXTERNALLIBS=no
   export HB_CONTRIBLIBS=no

instead of "no" in above settings you can also use the list of libraries
you want to compile if you want to chose only some of them.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to