On Thu, 25 Sep 2008, David Arturo Macias Corona wrote: Hi David,
> I see many surprises: > speedtst.prg > Harbour > ======= > ST > total application time: 47.13 > MT > total application time: 51.98 > > xHarbour > ======== > ST > total application time: 71.52 > MT > total application time: 119.68 Your results are more similar to the ones I have in my Linux box and only Harbour MT overhead is bigger. I took current Harbour and xHarbour code and unmodified speedtst.prg from Harbour SVN and I have: Harbour ST: total application time: 25.10 MT: total application time: 27.99 xHarbour: ST: total application time: 38.23 MT: total application time: 51.95 Harbour MT overhead to ST mode is: 11.51% xHarbour MT overhead to ST mode is: 35.89% xHarbour ST mode is 52.31% slower then Harbour xHarbour MT mode is 86.60% slower then Harbour In your results: Harbour MT overhead to ST mode is: 10.27% xHarbour MT overhead to ST mode is: 67.34% xHarbour ST mode is 51.75% slower then Harbour xHarbour MT mode is 130.26% slower then Harbour As I said the only one noticeable difference is bigger MT overhead in xHarbour for OS2 then in xHarbour for Linux. The rest is in practice proportionally the same. The overhead ~10-15 percent seems to be minimal cost we have to pay for MT mode in Harbour and cannot be significantly reduced. I also made test for cost of MT overhead in Linux when native compiler TLS support is disabled in Harbour. MT: total application time: 37.58 The overhead is huge: 49.72% and this is more close to the results in Windows which Viktor has. I made BCC build in my linux box and the results are: ST: 34.32 MT: 42.61 MT ooverhead is 24.16% Now we have HB_STACK_TLS_PRELOAD macro which allows to use Mindaugas inlined assembler code for TLS access: ST: 34.21 MT: 41.60 It reduces the overhead to 21.60%. Rather small. Any how I'll add it to SVN code so users can make test in real windows environment. If they do not show noticeable improvement then I'll remove it from SVN. Finally I tested cross build version of MinGW-3.4.5 and I'm very surprised with the results: ST: 22.35 MT: 31.69 The ST code is faster then native linux code. I noticed that programs executed by WINE runs fater on real multi CPU machine but I haven't expected anything like that. The MT overhead is 41.79%. This MinGW version does not have native TLS support so I create asm inline function based on the one created for BCC by Mindaugas and it reduced the MT speedtst time to 28.88 sec. (overhead 29.22%). I'll commit both inline asm functions to SF repository in a while and I would like to ask BCC and MinGW users to make speed tests for MT mode for Harbour compiled with and without -DHB_NO_TLS macro. It will be the answer if it's worth to keep them or not. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour