Teste de velocidade Ming x VS x BCC

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Teste de velocidade Ming x VS x BCC

Mensagem por Itamar M. Lins Jr. »

Ola!
Mingw melhor desempenho, mais ainda usando 64Bits.

Código: Selecionar todos

2017-03-29 17:58:35 Windows 7 6.1.7601 Service Pack 1
M: Harbour 3.2.0dev (r1703291750) MinGW GNU C 6.3 (32-bit) x86
V: Harbour 3.2.0dev (r1703291750) Microsoft Visual C++ 19.0.24215 (32-bit) x86
B: Harbour 3.2.0dev (r1703291750) Borland/Embarcadero C++ 7.2 (32-bit) x86
THREADS: 0 M V B
N_LOOPS: 1000000 ---- ---- ----
[ T000: empty loop overhead ]...................................0.03 0.05 0.05
==================================================================== ===== =====
[ T001: x := L_C ]..............................................0.03 .0.02 .0.06
[ T002: x := L_N ]..............................................0.02 .0.00 .0.05
[ T003: x := L_D ]..............................................0.02 .0.00 .0.03
[ T004: x := S_C ]..............................................0.02 .0.00 .0.05
[ T005: x := S_N ]..............................................0.03 .0.02 .0.06
[ T006: x := S_D ]..............................................0.02 .0.02 .0.06
[ T007: x := M->M_C ]...........................................0.03 .0.02 .0.05
[ T008: x := M->M_N ]...........................................0.03 .0.00 .0.05
[ T009: x := M->M_D ]...........................................0.02 .0.02 .0.05
[ T010: x := M->P_C ]...........................................0.03 .0.02 .0.06
[ T011: x := M->P_N ]...........................................0.03 .0.03 .0.03
[ T012: x := M->P_D ]...........................................0.03 .0.02 .0.06
[ T013: x := F_C ]..............................................0.09 .0.08 .0.09
[ T014: x := F_N ]..............................................0.09 .0.09 .0.16
[ T015: x := F_D ]..............................................0.06 .0.05 .0.08
[ T016: x := o:Args ]...........................................0.08 .0.08 .0.14
[ T017: x := o[2] ].............................................0.06 .0.02 .0.11
[ T018: round( i / 1000, 2 ) ]..................................0.09 .0.11 .0.19
[ T019: str( i / 1000 ) ].......................................0.27 .0.25 .0.55
[ T020: val( s ) ]..............................................0.12 .0.12 .0.16
[ T021: val( a [ i % 16 + 1 ] ) ]...............................0.23 .0.23 .0.31
[ T022: dtos( d - i % 10000 ) ].................................0.25 .0.34 .0.34
[ T023: eval( {|| i % 16 } ) ]..................................0.17 .0.14 .0.22
[ T024: eval( bc := {|| i % 16 } ) ]............................0.09 .0.11 .0.16
[ T025: eval( {| x | x % 16 }, i ) ]............................0.19 .0.17 .0.23
[ T026: eval( bc := {| x | x % 16 }, i ) ]......................0.12 .0.12 .0.19
[ T027: eval( {| x | f1( x ) }, i ) ]...........................0.23 .0.19 .0.31
[ T028: eval( bc := {| x | f1( x ) }, i ) ].....................0.19 .0.17 .0.25
[ T029: eval( bc := &("{| x | f1( x ) }"), i ) ]................0.19 .0.20 .0.28
[ T030: x := &( "f1(" + str(i) + ")" ) ]........................1.34 .1.12 .1.76
[ T031: bc := &( "{| x |f1(x)}" ), eval( bc, i ) ]..............1.51 .1.47 .2.28
[ T032: x := valtype( x ) + valtype( i ) ].....................0.22 .0.19 .0.25
[ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.34 .0.37 .0.61
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.16 .0.17 .0.22
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.20 .0.19 .0.27
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.20 .0.17 .0.27
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.19 .0.17 .0.27
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.17 .0.17 .0.27
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.17 .0.19 .0.27
[ T040: ascan( a, i % 16 ) ]....................................0.14 .0.20 .0.20
[ T041: ascan( a, {| x | x == i % 16 } ) ]......................1.44 .1.36 .1.95
[ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.44 .0.47 .0.64
[ T043: x := a ]................................................0.03 .0.02 .0.05
[ T044: x := {} ]...............................................0.05 .0.05 .0.08
[ T045: f0() ]..................................................0.03 .0.05 .0.06
[ T046: f1( i ) ]...............................................0.09 .0.11 .0.12
[ T047: f2( c[1...8] ) ]........................................0.09 .0.09 .0.09
[ T048: f2( c[1...40000] ) ]....................................0.06 .0.06 .0.11
[ T049: f2( @c[1...40000] ) ]...................................0.08 .0.09 .0.09
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.12 .0.11 .0.14
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.22 .0.20 .0.33
[ T052: f2( a ) ]...............................................0.05 .0.08 .0.09
[ T053: x := f4() ].............................................0.27 .0.31 .0.42
[ T054: x := f5() ].............................................0.12 .0.16 .0.22
[ T055: x := space(16) ]........................................0.06 .0.08 .0.12
[ T056: f_prv( c ) ]............................................0.20 .0.28 .0.37
==================================================================== ===== =====
[ total application time: ]....................................12.60 13.17 18.55
[ total real time: ]...........................................13.06 13.71 19.20
Com 64

Código: Selecionar todos

2017-04-03 07:49:09 Windows 7 6.1.7601 Service Pack 1
Harbour 3.2.0dev (r1703291750) MinGW GNU C 6.3 (64-bit) x86-64
====================================================================
2017-04-03 08:03:08 Windows 7 6.1.7601 Service Pack 1
Harbour 3.2.0dev (r1703291750) Microsoft Visual C 19.0.24215 (64-bit) x86-64
====================================================================
2017-04-03 07:48:15 Windows 7 6.1.7601 Service Pack 1
Harbour 3.2.0dev (r1703291750) LLVM/Clang C 3.3.1 (35759.1709ea1.58602a0) (64-bit) x86-64
====================================================================

THREADS: 0                                                      GCC   VC    BCC
N_LOOPS: 1000000                                               ===== ===== =====
[ T000: empty loop overhead ]...................................0.03  0.05  0.03
==================================================================== ===== =====
[ T001: x := L_C ]..............................................0.00  0.02  0.02
[ T002: x := L_N ]..............................................0.00  0.00  0.02
[ T003: x := L_D ]..............................................0.00  0.02  0.02
[ T004: x := S_C ]..............................................0.00  0.03  0.03
[ T005: x := S_N ]..............................................0.00  0.02  0.02
[ T006: x := S_D ]..............................................0.00  0.02  0.02
[ T007: x := M->M_C ]...........................................0.02  0.03  0.03
[ T008: x := M->M_N ]...........................................0.00  0.03  0.02
[ T009: x := M->M_D ]...........................................0.00  0.02  0.02
[ T010: x := M->P_C ]...........................................0.00  0.03  0.03
[ T011: x := M->P_N ]...........................................0.00  0.02  0.03
[ T012: x := M->P_D ]...........................................0.00  0.03  0.03
[ T013: x := F_C ]..............................................0.06  0.12  0.11
[ T014: x := F_N ]..............................................0.08  0.11  0.09
[ T015: x := F_D ]..............................................0.03  0.06  0.06
[ T016: x := o:Args ]...........................................0.06  0.12  0.09
[ T017: x := o[2] ].............................................0.02  0.06  0.06
[ T018: round( i / 1000, 2 ) ]..................................0.09  0.14  0.12
[ T019: str( i / 1000 ) ].......................................0.27  0.27  0.33
[ T020: val( s ) ]..............................................0.08  0.14  0.11
[ T021: val( a [ i % 16 + 1 ] ) ]...............................0.12  0.25  0.19
[ T022: dtos( d - i % 10000 ) ].................................0.14  0.23  0.19
[ T023: eval( {|| i % 16 } ) ]..................................0.14  0.28  0.19
[ T024: eval( bc := {|| i % 16 } ) ]............................0.09  0.17  0.14
[ T025: eval( {| x | x % 16 }, i ) ]............................0.12  0.22  0.19
[ T026: eval( bc := {| x | x % 16 }, i ) ]......................0.09  0.16  0.16
[ T027: eval( {| x | f1( x ) }, i ) ]...........................0.14  0.27  0.22
[ T028: eval( bc := {| x | f1( x ) }, i ) ].....................0.09  0.22  0.19
[ T029: eval( bc := &("{| x | f1( x ) }"), i ) ]................0.11  0.22  0.19
[ T030: x := &( "f1(" + str(i) + ")" ) ]........................1.00  1.62  1.53
[ T031: bc := &( "{| x |f1(x)}" ), eval( bc, i ) ]..............1.26  2.07  1.95
[ T032: x := valtype( x ) +  valtype( i ) ].....................0.12  0.25  0.22
[ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........0.28  0.42  0.39
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.09  0.19  0.14
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.09  0.22  0.16
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.09  0.20  0.16
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.11  0.20  0.14
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.09  0.20  0.16
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.09  0.20  0.16
[ T040: ascan( a, i % 16 ) ]....................................0.11  0.23  0.17
[ T041: ascan( a, {| x | x == i % 16 } ) ]......................1.12  2.00  1.53
[ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....0.33  0.64  0.51
[ T043: x := a ]................................................0.00  0.03  0.03
[ T044: x := {} ]...............................................0.05  0.08  0.06
[ T045: f0() ]..................................................0.02  0.03  0.03
[ T046: f1( i ) ]...............................................0.03  0.09  0.06
[ T047: f2( c[1...8] ) ]........................................0.02  0.06  0.05
[ T048: f2( c[1...40000] ) ]....................................0.03  0.06  0.06
[ T049: f2( @c[1...40000] ) ]...................................0.02  0.06  0.05
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.03  0.11  0.08
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.12  0.41  0.28
[ T052: f2( a ) ]...............................................0.02  0.08  0.06
[ T053: x := f4() ].............................................0.28  0.27  0.50
[ T054: x := f5() ].............................................0.08  0.16  0.14
[ T055: x := space(16) ]........................................0.06  0.11  0.11
[ T056: f_prv( c ) ]............................................0.11  0.27  0.19
==================================================================== ===== =====
[ total application time: ].....................................9.19 16.19 13.54
[ total real time: ]............................................9.27 16.26 13.75

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Teste de velocidade Ming x VS x BCC

Mensagem por JoséQuintas »

Independente disso, pode ser que acabemos usando o mingw ao invés do msvc.

Motivo: o run-time do Microsoft Visual C.

Como atualmente se misturam Windows XP e posteriores, o msvc pode acabar exigindo instalar run-time, o que vai acabar tornando mais prático distribuir com mingw mesmo.

Até saiu o MSVC 2017, e o Harbour teve ajustes pra ele, mas nem sei se funcionaria no XP....

Pra quem não sabe:
run-time seria algo como uma LIB para o executável, contendo partes principais de execução.
Sem isso, o programa não roda.
Para as llnguagens Microsoft já vém pré-instalada no Windows, mas lógico, uma determinada versão.
Versões diferentes, só instalando... se o Windows aceitar.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder