Przemek:

If you want then you can also try to use -O3 instead of -O2 GCC
optimization flag. It enables some additional optimizations like
automatic normal function inlining. Probably it will give some
additional 2-5% of speed improvement in ST and MT mode.

I made a fresh build using:
CFLAGS = -W -Wall -O3
        
The improvement was marginal
slightly lower with ST and slightly higher with MT
Both results can be explained by variations in OS tasks too

ST
   total application time:                              45.81
   total real time:                                     45.81
MT
   total application time:                              52.78
   total real time:                                     52.78

Previous:
ST
     total application time:                              47.13
     total real time:                                     47.14
MT
     total application time:                              51.98
     total real time:                                     51.98

David Macias



Startup loop to increase CPU clock...

09/26/08 06:21:27 Harbour 1.1.0dev (Rev. 9508), OS/2 4.50
ARR_LEN =         16
N_LOOPS =    1000000
empty loops overhead =          0.13
CPU usage -> secondsCPU()

c:=L_C ->                                             0.12
n:=L_N ->                                             0.10
d:=L_D ->                                             0.10
c:=M_C ->                                             0.12
n:=M_N ->                                             0.10
d:=M_D ->                                             0.10
(sh) c:=F_C ->                                        0.43
(sh) n:=F_N ->                                        0.36
(sh) d:=F_D ->                                        0.20
(ex) c:=F_C ->                                        0.41
(ex) n:=F_N ->                                        0.37
(ex) d:=F_D ->                                        0.21
n:=o:GenCode ->                                       0.32
n:=o[8] ->                                            0.21
round(i/1000,2) ->                                    0.47
str(i/1000) ->                                        1.35
val(a3[i%ARR_LEN+1]) ->                               0.84
dtos(j+i%10000-5000) ->                               0.98
eval({||i%ARR_LEN}) ->                                0.44
eval({|x|x%ARR_LEN},i) ->                             0.49
eval({|x|f1(x)},i) ->                                 0.69
&('f1('+str(i)+')') ->                                7.72
eval([&('{|x|f1(x)}')]) ->                            0.71
j := valtype(a)+valtype(i) ->                         0.88
j := str(i%100,2) $ a2[i%ARR_LEN+1] ->                1.73
j := val(a2[i%ARR_LEN+1]) ->                          0.92
j := a2[i%ARR_LEN+1] == s ->                          0.61
j := a2[i%ARR_LEN+1] = s ->                           0.69
j := a2[i%ARR_LEN+1] >= s ->                          0.67
j := a2[i%ARR_LEN+1] < s ->                           0.68
aadd(aa,{i,j,s,a,a2,t,bc}) ->                         2.21
f0() ->                                               0.28
f1(i) ->                                              0.39
f2(c[8]) ->                                           0.33
f2(c[40000]) ->                                       0.33
f2(@c[40000]) ->                                      0.31
f2(c[40000]); c2:=c ->                                0.45
f2(@c[40000]); c2:=c ->                               0.44
f3(a,a2,c,i,j,t,bc) ->                                0.70
f2(a2) ->                                             0.34
s:=f4() ->                                            1.25
s:=f5() ->                                            0.63
ascan(a,i%ARR_LEN) ->                                 0.60
ascan(a2,c+chr(i%64+64)) ->                           2.39
ascan(a,{|x|x==i%ARR_LEN}) ->                         6.00
============================================================
total application time:                              45.81
total real time:                                     45.81



Startup loop to increase CPU clock...

09/26/08 06:25:11 Harbour 1.1.0dev (Rev. 9508) (MT), OS/2 4.50
ARR_LEN =         16
N_LOOPS =    1000000
empty loops overhead =          0.15
CPU usage -> secondsCPU()

c:=L_C ->                                             0.13
n:=L_N ->                                             0.10
d:=L_D ->                                             0.11
c:=M_C ->                                             0.14
n:=M_N ->                                             0.12
d:=M_D ->                                             0.11
(sh) c:=F_C ->                                        0.43
(sh) n:=F_N ->                                        0.37
(sh) d:=F_D ->                                        0.20
(ex) c:=F_C ->                                        0.42
(ex) n:=F_N ->                                        0.36
(ex) d:=F_D ->                                        0.20
n:=o:GenCode ->                                       0.36
n:=o[8] ->                                            0.23
round(i/1000,2) ->                                    0.48
str(i/1000) ->                                        1.43
val(a3[i%ARR_LEN+1]) ->                               0.92
dtos(j+i%10000-5000) ->                               1.07
eval({||i%ARR_LEN}) ->                                0.50
eval({|x|x%ARR_LEN},i) ->                             0.54
eval({|x|f1(x)},i) ->                                 0.78
&('f1('+str(i)+')') ->                                8.98
eval([&('{|x|f1(x)}')]) ->                            0.81
j := valtype(a)+valtype(i) ->                         0.97
j := str(i%100,2) $ a2[i%ARR_LEN+1] ->                1.85
j := val(a2[i%ARR_LEN+1]) ->                          0.98
j := a2[i%ARR_LEN+1] == s ->                          0.64
j := a2[i%ARR_LEN+1] = s ->                           0.70
j := a2[i%ARR_LEN+1] >= s ->                          0.70
j := a2[i%ARR_LEN+1] < s ->                           0.72
aadd(aa,{i,j,s,a,a2,t,bc}) ->                         3.52
f0() ->                                               0.29
f1(i) ->                                              0.44
f2(c[8]) ->                                           0.35
f2(c[40000]) ->                                       0.35
f2(@c[40000]) ->                                      0.34
f2(c[40000]); c2:=c ->                                0.47
f2(@c[40000]); c2:=c ->                               0.47
f3(a,a2,c,i,j,t,bc) ->                                0.82
f2(a2) ->                                             0.35
s:=f4() ->                                            1.34
s:=f5() ->                                            0.79
ascan(a,i%ARR_LEN) ->                                 0.67
ascan(a2,c+chr(i%64+64)) ->                           2.54
ascan(a,{|x|x==i%ARR_LEN}) ->                         7.74
============================================================
total application time:                              52.78
total real time:                                     52.78




_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to