On Tue, 17 Mar 2009, Angel Pais wrote:
Hi,
> That behaviour is caused by this 3 commands:
> #command ? => outstd(EOL)
> #command ? <xx,...> => outstd(EOL);outstd(<xx>)
> #command ?? <xx,...> => outstd(<xx>)
> qout() sends output to console window
Yes it is.
> outstd() sends output to standar program output, and you only use this if
> you want to write a cgi program.
when you write any program which should send its output to stdout not
only CGI. speedtst is such program and it intentionally sends results
to stdout for easy redirection.
> So in alaska's dialect console <> stdout
Just like in Harbour and Clipper but looks that in xbase++ stdout
output redirected to console is broken.
I also suggest to build Harbour with
set HB_USER_CFLAGS="-DHB_FM_STATISTICS_OFF"
FM statistic module may have serious speed overhead.
There are also some other things which may cause some small speed
overhead in both compilers like:
- debugger support (-b option in Harbour)
- line numbers (can be disabled by -l Harbour option)
To make the test comparable I suggest to not enable any debug information
and disable line numbering (-l) in both compilers.
For Harbour speedtst builds use -gc3 and -ko switches. -ko enables some
optimizations which breaks some strict Clipper compatibility, f.e.
different RT errors on wrong types in math operations but as I can see
XPP does not respect Clipper compatibility in much more serious places
so we should enable such optimizations also in Harbour.
The results are quite interesting, f.e. even when test is executed by
single thread we can see what speed improvement we should expect if we
add support for whole function optimization on expression level. Now
we only have only few full function optimizations only on PCODE level.
But I'll write more about it when I collect more results to confirm
few things.
Meanwhile I have a question about MSVC. The MSWIN documentation says
that Interlocked*() functions should be inlined by compiler if possible.
Viktor's ST and MT Harbour results suggests that MSVC does not make it.
So I would like to ask MSVC developers to create inline assembler
macros for for atomic inc/dec operation and make tests. It should be
very simple job for someone who know MSVC ASM syntax (of course if
this compiler has such functionality).
Here is the code I made for GCC x86 builds:
static __inline__ void hb_atomic_inc32( volatile int * p )
{
__asm__ __volatile__(
"lock; incl %0\n"
:"=m" (*p) :"m" (*p)
);
}
static __inline__ int hb_atomic_dec32( volatile int * p )
{
unsigned char c;
__asm__ __volatile__(
"lock; decl %0\n"
"sete %1\n"
:"=m" (*p), "=qm" (c) :"m" (*p) : "memory"
);
return c == 0;
}
Can you try to make sth similar for MSVC?
For hb_atomic_inc32 we need only:
LOCK;
INC p;
and for hb_atomic_dec32:
LOCK;
DEC p;
SETNE;
written in the form acceptable for MSVC.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour