Hi, >> Is it also true that C++ mode enhances speed for >> x86 code? I see it slightly does for x86_64. > > I do not know. In general C++ mode is a little bit more restrictive then > pure C so it's possible that some compilers which want to keep strict C > standards do not make some optimizations which can be safely enabled in > C++ mode. This is the only reason of potential differences because C++ RTL > usually is a little bit more heavy and slower. > I remember that in the past we have in the source code some notes about > MSVC "bugs" with workarounds for them. In fact it was examples of code > which interacts with optimizer and in C++ mode may not work so the problem > was in our code not in MSVC. For very long time we were using MSVC in C++ > mode only so I cannot say if MS enabled all possible optimization also for > C mode or it was exploited in C++ mode only. > It's interesting to check if there are any speed differences in MSVC C and > C++ builds. > Can you check it?
I checked mingw-tdm-2 4.4.1, and C++ turned out to be consistently faster by 5% than plain C. Calculated by 4-4 speedtst runs, dropping min/max and averaging rest 2-2 results. Env: MBP iC2D/2.8 -> OS X 10.6 (64-bit kernel) -> VMWare 3.0.2 -> Win7 x64 Brgds, Viktor _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour