On Thu, 10 Nov 2011, Enrico Maria Giordano wrote: Hi,
> > Anyhow maybe you will find this real life code as more interesting. > > Long time ago one of my friends asked me about help in one mathematical > > problem. He had to resolve this equation: > > TOTEK > > + TO > > + TWOJA > > ========= > > SZANSA > > knowing that T, O, E, K, W, J, A, S, Z and N are different decimal > > digits. > Ok, but you know that the most Clipper/Harbour programmers use this language > for business applications. And in this type of applications the bottleneck > is invariably the speed of the mass storage device or (worst) the speed of > the network. I'm interested in some real life test in this sense. I do not agree. Such calculations are vital part of many business applications. They are necessary to resolve NP problems which very often appear in business life. See http://en.wikipedia.org/wiki/NP_%28complexity%29 for more information. Also many reports in business applications have to collect and convert data which is later stored (before presentation) in hashes, arrays or as long strings. Here HVM speed is also important and often most expensive part of executed code, i.e. non optimized += operation for string may increase total time _hundreds_ or _thousands_ of times. I.e. please be so kind and download this code: https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour/tests/speedstr.prg Compile it with Harbour and xHarbour and compare results. Then change: #define N_LOOP 200000 to: #define N_LOOP 2000000 and repeat your tests. Here are Harbour results for such modified version: LOCAL += 0.36 sec. STATIC += 0.35 sec. ARRAY[] += 0.49 sec. PRIVATE += 0.35 sec. MACRO += 1.77 sec. OBJECT:VAR += 0.53 sec. Now I'm waiting for xHarbour results and probably I'll send them later if it finishes in some reasonable time. I hope that you will not say that using += operator with STATICs, PUBLICs, PRIVATEs, MACROs or object variables to collect data from some tables or simply to convert DBF table to HTML is not real world application in [x]Harbour/Clipper world. So far you were calling "real world applications" programs which process files accessed using some file server protocol on rather slow network connections. I do not think that it is the same for other [x]Harbour users and it will be good if you add such information when people ask you about performance, i.e. to create CGI scripts or web services because in most of cases they will access files locally. Of course the IO overhead can be critical especially if you are accessing files throw slow network. Anyhow a lot of users used to create applications in client server mode and on the user side there is only thin UI client and whole data processing is on the server side. In such cases IO overhead does not consume 90% of time. BTW my applications recompiled with xHarbour needs about 50% more time to generate reports then compiled with Harbour and my code is rather xHarbour friendly and does not try to exploit some time critical problems like in speedstr.prg. But I know quite well xHarbour core code so I know how to create such code. best regards, Przemek ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ xHarbour-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xharbour-developers

