Hi Przemek,

Is it also true that C++ mode enhances speed for 
x86 code? I see it slightly does for x86_64.

Brgds,
Viktor

On 2010 Mar 10, at 16:43, Przemysław Czerpak wrote:

> On Wed, 10 Mar 2010, francesco perillo wrote:
> 
> Hi,
> 
>>> BCC is a joke these days.
>> ooops... I have a production site working with a bbc version of Harbour...
> 
> It works but it's not very good choice.
> There are some very serious bugs in BCC but for the ones known for us
> we have workarounds, i.e. we do not use any floating point BCC low level
> functions like _fpclass[l]() because they break 'double' number
> calculations reducing the precision to 'float' level or we use
> DLMALLOC as default memory manager because the one in BCC can cause
> memory corruption in some situations.
> But more important is the fact that BCC was not extended in last years
> and now in comparison to other modern C compilers it does not have many
> important features and optimization methods.
> In contrast nearly each new GCC version has some important extensions
> which improve optimization code and performance of final applications,
> i.e. GCC 4.4 generates nearly twice faster code then 2.9x. (see results
> below).
> 
> Harbour core code is written in a way which should help in optimization
> process for compilers using some advanced optimization methods like
> automatic autoinlining or automatic detecting of restricted areas due
> to constant declarations or strict aliasing rules. It even does not have
> such simple optimization methods like using assembler inline code for
> commonly used CTRL functions like memset(), memcmp(), memmove(),
> str*(), etc.
> The results can be visible in the speed of final binaries.
> You can use harbour/tests/speedtst.prg to compare the speed of Harbour
> compiled with different C compilers.
> You can also use it with other xbase/clipper compatible languages like
> xHarbour, Clipper, CLIP, FlagShip, xBase++.
> 
> Below I'm attaching results for current Harbour SVN code. I cannot make
> any tests with MSVC because I cannot use it with WINE. The speedtst.prg
> code does not make any IO operations which may effect execution speed
> so WINE and DOSEMU can execute final binaries naively without any time
> consuming interrupts which may the results.
> I used "official" MinGW with GCC 3.4.5 which gives slower code then GCC4.4.
> I also do not have the newest PelleC 6.0.
> 
> GCC4.5 was used with -flto which enable link time optimization (LTO).
> As you can see GCC4.4 in C++ mode and GCC4.5 gives the fastest code
> and old PelleC compiler used by xHarbour.com (XCC) gives the slowest
> code.
> I haven't installed yet C++ compiler for GCC4.5 which potentially should
> give the fastest code.
> Please note that all OpenWatcom builds were created with disable IPO
> optimization in HVM code. Due to compilation time we disabled HB_HVM_ALL=yes
> optimization which improve the performance of final OW binaries.
> 
> Here are sorted the results.
> 
> Harbour 2.1.0dev (Rev. 14060) GNU C 4.5 (64-bit) x86-64
>   [ total application time: ]....................................14.66
> 
> Harbour 2.1.0dev (Rev. 14060) GNU C++ 4.4 (64-bit) x86-64
>   [ total application time: ]....................................14.65
> 
> Harbour 2.1.0dev (Rev. 14060) GNU C 4.4 (64-bit) x86-64
>   [ total application time: ]....................................14.95
> 
> Harbour 2.1.0dev (Rev. 14060) Intel(R) (ICC) C 11.0 (64-bit) x86-64
>   [ total application time: ]....................................16.22
> 
> Harbour 2.1.0dev (Rev. 14060) Open64 C 4.2.1 (64-bit) x86-64
>   [ total application time: ]....................................16.29
> 
> Harbour 2.1.0dev (Rev. 14060) LLVM/Clang C 4.2.1 (64-bit) x86-64
>   [ total application time: ]....................................17.57
> 
> Harbour 2.1.0dev (Rev. 14060) GNU C 4.4 (32-bit) x86
>   [ total application time: ]....................................18.13
> 
> Harbour 2.1.0dev (Rev. 14060) Sun C (ident 0x5100) (64-bit) x86-64
>   [ total application time: ]....................................18.21
> 
> Harbour 2.1.0dev (Rev. 14060) MinGW GNU C 3.4.5 (32-bit) x86
>   [ total application time: ]....................................19.09
> 
> Harbour 2.1.0dev (Rev. 14060) Delorie GNU C 4.3.2 (DJGPP 2.04) (32-bit) x86
>   [ total application time: ]....................................23.18
> 
> Harbour 2.1.0dev (Rev. 14060) Open Watcom C 12.80 (32-bit) x86 (LINUX)
>   [ total application time: ]....................................23.54
> 
> Harbour 2.1.0dev (Rev. 14060) Open Watcom C++ 12.80.8 (32-bit) x86 (WIN)
>   [ total application time: ]....................................25.65
> 
> Harbour 2.1.0dev (Rev. 14060) Open Watcom C 12.80 (32-bit) x86 (DOS)
>   [ total application time: ]....................................25.76
> 
> Harbour 2.1.0dev (Rev. 14060) Borland C++ 5.5 (32-bit) x86
>   [ total application time: ]....................................27.48
> 
> Harbour 2.1.0dev (Rev. 14060) GNU C 2.96 (32-bit) x86
>   [ total application time: ]....................................29.39
> 
> Harbour 2.1.0dev (Rev. 14060) Pelles ISO C Compiler 4.50 (32-bit) x86
>   [ total application time: ]....................................30.83
> 
> Harbour 2.1.0dev (Rev. 14060) Pelles ISO C Compiler 2.70 (32-bit) x86 (XCC)
>   [ total application time: ]....................................34.70
> 
> 
> For comparison I'm attaching result for some other compatible compilers.
> xHarbour was compiled from current CVS with some small improvements and
> fixes.
> 
> xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6691) GNU C 4.4 (64 bit) ?
>   [ total application time: ]....................................32.42
> 
> xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6691) MinGW GNU C 3.4.5 (32 bit) ?
>   [ total application time: ]....................................33.78
> 
> xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6691) Borland C++ 5.5 (32 bit) ?
>   [ total application time: ]....................................44.02
> 
> FlagShip 4.48.2460 (1024 users) ?
>   [ total application time: ]....................................80.04
> 
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to