20a5e7c24b53db4b75e3d630c8985a7e5524106d
* harbour/contrib/xhb/xcstr.prg
% fixed fatal for performance code used to serialize hash arrays
in ValToPrg() functions. I know that xHarbour does not have native
support for hash array iteration in FOR EACH statements so it's
necessary to make some hacks but even there serialization can be
quite easy done by simple FOR/NEXT loop and function calls to
access given keys and values.
Please remember that sending :keys or :values messages to hash
arrays is very expensive in both languages because each time
new array is created with copy of all key or values items.
In the old code :values message was send inside a loop so to serialize
hash array with 1000 items it was created 1000 arrays with 1000
items inside each of them. It means 1000000 unnecessary item copy
calls. Modern computers are very fast but such code can kill the
performance on any hardware. It's also classic example when forcing
FOR EACH usage in all places can give code thousands times slower
then code using simple FOR/NEXT.
% few minor optimizations
Description
Harbour Core — Reference source for Five development
Languages
C
80.3%
xBase
17.8%
Makefile
0.6%
C++
0.4%
Harbour
0.4%
Other
0.3%