On Fri, 26 Mar 2010, Maurilio Longo wrote:
Hi,
> > Can you check the performance of above functions in some simple loop?
> See attached code, it gives these results on my PC when compiled with
> gcc -O3 -Wall -o gettid.exe gettid.c
>
> (E:\harbour\test)gettid
> Time _hb_gettid() 688
> Time _gettid() 1787
> The numers are in milliseconds for a 100 million times loop.
Thank you very much.
Such results can be a little bit change by autoinlining when -O3 is used
so it would be nice if you can also test this function:
ULONG _hb_gettid2( void )
{
ULONG tid = 0;
PTIB ptib = NULL;
if( DosGetInfoBlocks( &ptib, NULL ) == NO_ERROR )
tid = ptib->tib_ptib2->tib2_ultid;
return tid;
}
in your code. Just for information about real cost of DosGetInfoBlocks().
Maybe it's not such big and it internally makes exactly the same operations.
> > When threads ends then it's TLS area is freed so such information will be
> > lost in a while.
> Yes, but if we have an object on HVM, this object could have those numbers
> and they'll stay there until the object is disposed.
Yes it is and it's good place to store such information but it's not TLS
area :-)
best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour