Strange results, or I am confused ? factor are around 2 (total 1.90) but computer is SINGLE CPU
The real factor is 1.00. See the total real time values: 260.81 - 130.34 = 130.47 130.34 / 130.47 = 99.9 but in 130.47 we have also cost of test envelop so it's in practice >1.00. Such effect can be caused by irregular internal real time clock counter updating. Such things happens in Win9x. Probably OS2 does not update real time clock counter when more then one thread is executed simultaneously. F.e. it can retrieve clock value from cache when other threads are still active waiting for CPU and refresh it only when current thread is the one working. In such case in the second column you will have only the time of the second thread because when 1-st one finished the clock counter is not updated and returns starting value. Above results suggest that exactly sth like that happened in your case. It's yet another bad side effect of using real time clock. Fortunatelly here real results can be recalculated from total real time. It will be interesting to see how the same test will look in OS2 on multi CPU machine.
For my comment about factor I was based in your message: "I've just run this test on single CPU machine with Linux and SUSE 10.3 and all factors are equal to 1.0 or at least very close to this value and differences are on the time precision level (we are using real time not process time). " But as you say, may be some "irregular internal real time clock counter updating" in OS/2, and approach to 1 with single CPU are valid only in your environment. So an adjustment to the "measurement tool" is required :-) What I am sure is that these kind of tests are highly dependent of hardware/OS/software, or even a single motherboard Years ago I tested same CPU in two motherboards and performance difference was as much as 30 % Below are results for 4 and 8 threads in OS/2, single CPU AMD Athlon 2200+ 2.0 Ghz, 1 Gb RAM For comparison here are some results: 4 threads --thread=4 --scale --exclude=mem ========= Pritpal Bedi, Win2003, 4 logical CPU 3.6 Ghz [ TOTAL ]____________________________________ 81.87 81.06 -> 1.01 ============================================================================ [ total application time: ]...................................382.58 [ total real time: ]..........................................162.98 Pritpal Bedi, WinXP SP2, 2 logical CPU 3 Ghz [ TOTAL ]____________________________________ 96.06 96.13 -> 1.00 ============================================================================ [ total application time: ]...................................285.17 [ total real time: ]..........................................192.22 Phil Barnett, 4 logical CPU, Quad core Phenom 9600, 32 bit Fedora 9 [ TOTAL ]____________________________________ 51.13 74.80 -> 0.68 ============================================================================ [ total application time: ]...................................331.97 [ total real time: ]..........................................125.94 David Macias, OS/2, 1 logical CPU 2.0 Ghz, AMD 2200+ [ TOTAL ]____________________________________159.59 98.94 -> 1.61 ============================================================================ [ total application time: ]...................................258.61 [ total real time: ]..........................................258.61 About real time, considering that 4CPU clock speed is higher, there are not much difference between Windows 4CPU and 2CPU, and both are not much ahead of AMD 1CPU Phenom 4CPU make in near half of real time the same work made by AMD 1CPU 8 threads --thread=8 --scale --exclude=mem ========= Phil Barnett, 4 logical CPU, Quad core Phenom 9600, 32 bit Fedora 9 [ TOTAL ]____________________________________101.79 150.62 -> 0.68 ============================================================================ [ total application time: ]...................................672.29 [ total real time: ]..........................................252.42 David Macias, OS/2, 1 logical CPU 2.0 Ghz, AMD 2200+ [ TOTAL ]____________________________________308.70 173.32 -> 1.78 ============================================================================ [ total application time: ]...................................482.10 [ total real time: ]..........................................482.10 Again, Phenom 4CPU make in near half of real time the same work made by AMD 1CPU David Macias 10/07/08 03:52:06 OS/2 4.50 Harbour 1.1.0dev (Rev. 9557) (MT)+ EMX GNU C 3.3.5 (32 bit) THREADS: 4 N_LOOPS: 1000000 excluded tests: 029 030 023 025 027 040 041 043 052 053 019 022 031 032 054 1 th. 4 th. factor ============================================================================ [ T001: x := L_C ]_______________________________ 3.50 1.19 -> 2.94 [ T002: x := L_N ]_______________________________ 1.86 0.91 -> 2.04 [ T003: x := L_D ]_______________________________ 1.78 1.06 -> 1.67 [ T004: x := S_C ]_______________________________ 2.07 1.15 -> 1.81 [ T005: x := S_N ]_______________________________ 1.84 1.13 -> 1.63 [ T006: x := S_D ]_______________________________ 1.90 1.15 -> 1.65 [ T007: x := M_C ]_______________________________ 2.11 1.34 -> 1.57 [ T008: x := M_N ]_______________________________ 1.86 1.25 -> 1.49 [ T009: x := M_D ]_______________________________ 1.84 1.28 -> 1.43 [ T010: x := P_C ]_______________________________ 1.76 1.31 -> 1.35 [ T011: x := P_N ]_______________________________ 1.78 1.25 -> 1.43 [ T012: x := P_D ]_______________________________ 1.91 1.25 -> 1.53 [ T013: x := F_C ]_______________________________ 4.30 2.72 -> 1.58 [ T014: x := F_N ]_______________________________ 4.25 2.21 -> 1.92 [ T015: x := F_D ]_______________________________ 2.10 1.54 -> 1.36 [ T016: x := o:GenCode___________________________ 4.02 2.57 -> 1.56 [ T017: x := o[8] ]______________________________ 3.07 1.69 -> 1.82 [ T018: round( i / 1000, 2 ) ]___________________ 5.07 3.15 -> 1.61 [ T020: val( s ) ]_______________________________ 4.31 3.05 -> 1.41 [ T021: val( a [ i % 16 + 1 ] ) ]________________ 8.43 5.12 -> 1.65 [ T024: eval( bc := { || i % 16 } ) ]____________ 5.12 3.27 -> 1.57 [ T026: eval( bc := { |x| x % 16 }, i ) ]________ 4.55 3.20 -> 1.42 [ T028: eval( bc := { |x| f1( x ) }, i ) ]_______ 7.16 4.26 -> 1.68 [ T033: x := a[ i % 16 + 1 ] == s ]______________ 5.61 3.66 -> 1.53 [ T034: x := a[ i % 16 + 1 ] = s ]_______________ 6.84 4.28 -> 1.60 [ T035: x := a[ i % 16 + 1 ] >= s ]______________ 6.68 4.15 -> 1.61 [ T036: x := a[ i % 16 + 1 ] <= s ]______________ 7.03 4.29 -> 1.64 [ T037: x := a[ i % 16 + 1 ] < s ]_______________ 6.89 4.43 -> 1.56 [ T038: x := a[ i % 16 + 1 ] > s ]_______________ 6.67 4.12 -> 1.62 [ T039: ascan( a, i % 16 ) ]_____________________ 6.74 4.58 -> 1.47 [ T042: x := a ]_________________________________ 1.88 1.16 -> 1.62 [ T044: f0() ]___________________________________ 2.81 1.88 -> 1.49 [ T045: f1( i ) ]________________________________ 3.24 2.61 -> 1.24 [ T046: f2( c[1...8] ) ]_________________________ 4.16 2.33 -> 1.78 [ T047: f2( c[1...40000] ) ]_____________________ 3.86 1.98 -> 1.95 [ T048: f2( @c[1...40000] ) ]____________________ 3.95 2.31 -> 1.71 [ T049: f2( @c[1...40000] ), c2 := c ]___________ 4.81 2.65 -> 1.82 [ T050: f3( a, a2, s, i, s2, bc, i, n, x ) ]_____ 7.60 4.91 -> 1.55 [ T051: f2( a ) ]________________________________ 4.21 2.55 -> 1.65 ======================================================================= [ TOTAL ]____________________________________159.59 98.94 -> 1.61 ============================================================================ [ total application time: ]...................................258.61 [ total real time: ]..........................................258.61 10/07/08 01:26:01 OS/2 4.50 Harbour 1.1.0dev (Rev. 9557) (MT)+ EMX GNU C 3.3.5 (32 bit) THREADS: 8 N_LOOPS: 1000000 excluded tests: 029 030 023 025 027 040 041 043 052 053 019 022 031 032 054 1 th. 8 th. factor ============================================================================ [ T001: x := L_C ]_______________________________ 6.18 2.19 -> 2.82 [ T002: x := L_N ]_______________________________ 3.40 2.09 -> 1.62 [ T003: x := L_D ]_______________________________ 3.35 2.01 -> 1.67 [ T004: x := S_C ]_______________________________ 3.77 2.27 -> 1.66 [ T005: x := S_N ]_______________________________ 3.17 2.05 -> 1.55 [ T006: x := S_D ]_______________________________ 3.10 2.05 -> 1.51 [ T007: x := M_C ]_______________________________ 3.88 2.32 -> 1.68 [ T008: x := M_N ]_______________________________ 3.68 2.05 -> 1.79 [ T009: x := M_D ]_______________________________ 3.49 2.11 -> 1.66 [ T010: x := P_C ]_______________________________ 3.73 2.14 -> 1.75 [ T011: x := P_N ]_______________________________ 3.76 1.92 -> 1.96 [ T012: x := P_D ]_______________________________ 3.64 2.13 -> 1.71 [ T013: x := F_C ]_______________________________ 7.93 4.69 -> 1.69 [ T014: x := F_N ]_______________________________ 8.18 4.30 -> 1.90 [ T015: x := F_D ]_______________________________ 4.06 2.73 -> 1.49 [ T016: x := o:GenCode ]_________________________ 8.03 4.11 -> 1.95 [ T017: x := o[8] ]______________________________ 5.63 3.10 -> 1.81 [ T018: round( i / 1000, 2 ) ]___________________ 8.63 5.42 -> 1.59 [ T020: val( s ) ]_______________________________ 8.86 4.95 -> 1.79 [ T021: val( a [ i % 16 + 1 ] ) ]________________ 15.77 8.94 -> 1.76 [ T024: eval( bc := { || i % 16 } ) ]____________ 9.36 5.43 -> 1.73 [ T026: eval( bc := { |x| x % 16 }, i ) ]________ 9.90 5.64 -> 1.76 [ T028: eval( bc := { |x| f1( x ) }, i ) ]_______ 13.00 7.06 -> 1.84 [ T033: x := a[ i % 16 + 1 ] == s ]______________ 11.47 7.01 -> 1.64 [ T034: x := a[ i % 16 + 1 ] = s ]_______________ 14.24 7.52 -> 1.89 [ T035: x := a[ i % 16 + 1 ] >= s ]______________ 13.04 7.28 -> 1.79 [ T036: x := a[ i % 16 + 1 ] <= s ]______________ 13.13 7.77 -> 1.69 [ T037: x := a[ i % 16 + 1 ] < s ]_______________ 13.07 7.61 -> 1.72 [ T038: x := a[ i % 16 + 1 ] > s ]_______________ 13.37 7.25 -> 1.84 [ T039: ascan( a, i % 16 ) ]_____________________ 14.69 7.69 -> 1.91 [ T042: x := a ]_________________________________ 3.76 2.42 -> 1.55 [ T044: f0() ]___________________________________ 5.26 3.18 -> 1.66 [ T045: f1( i ) ]________________________________ 8.35 4.21 -> 1.98 [ T046: f2( c[1...8] ) ]_________________________ 7.86 4.16 -> 1.89 [ T047: f2( c[1...40000] ) ]_____________________ 6.65 4.20 -> 1.58 [ T048: f2( @c[1...40000] ) ]____________________ 8.02 4.10 -> 1.96 [ T049: f2( @c[1...40000] ), c2 := c ]___________ 8.34 4.99 -> 1.67 [ T050: f3( a, a2, s, i, s2, bc, i, n, x ) ]_____ 14.88 8.10 -> 1.84 [ T051: f2( a ) ]________________________________ 8.09 4.15 -> 1.95 ======================================================================== [ TOTAL ]____________________________________308.70 173.32 -> 1.78 ============================================================================ [ total application time: ]...................................482.10 [ total real time: ]..........................................482.10 _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour