Sábado, 15 Octubre 2011 12:09

Comparativa Python 2.6 vs 2.7

Valora este artículo
(0 votos)

Este test de rendimiento entre las diferentes versiones de python y los diferentes "Template Engine" (django, cheetah, kid, genshi, mako y Tenjin), usando como herramienta los benchmark proporcionados por Tenjin

Usando como banco de pruebas un ordenador con Gentoo Linux 64Bits:

Ver código
Model name      : AMD Athlon(tm) II X2 255 Processor
cpu MHz         : 3100.000
bogomips        : 6228.15
 
 
Linux version 2.6.39-gentoo-r3
gcc 4.4.6
glibc 2.13
 
 
cheetah-2.4.4   genshi-0.6     django-1.3.1     kid-0.9.6
jinja-2.6       mako-0.4.2     Tenjin-1.0.2

Python 2.6.6

Ver código
                                    utime     stime     total      real
tenjin                             2.4400    0.0000    2.4400    2.4411
tenjin-create                      3.0300    0.1100    3.1400    3.1322
tenjin-str                         1.5600    0.0000    1.5600    1.5670
django                            49.9200    0.0000   49.9200   49.9329
django-create                     59.8000    0.1300   59.9300   59.9716
cheetah                           10.0900    0.0000   10.0900   10.0893
cheetah-create                    10.2500    0.0000   10.2500   10.2529
kid                              169.5000    0.0000  169.5000  169.5634
kid-create                       170.6300    0.0200  170.6500  170.7134
genshi                           104.9000    0.0000  104.9000  104.9571
genshi-create                    203.4300    0.2900  203.7200  203.9146
mako                               3.2700    0.0000    3.2700    3.3075
mako-create                        5.1400    0.1600    5.3000    5.2996
mako-nocache                      69.0900    0.3600   69.4500   69.5108
jinja2                             4.1800    0.0000    4.1800    4.1941
jinja2-create                     82.5500    0.3800   82.9300   83.0065

Python 2.7.2

Ver código
                                    utime     stime     total      real
tenjin                             1.9900    0.0000    1.9900    1.9957
tenjin-create                      2.6000    0.1100    2.7100    2.7158
tenjin-str                         1.2000    0.0000    1.2000    1.1962
django                            48.4400    0.0000   48.4400   48.4615
django-create                     57.6800    0.1400   57.8200   57.8634
cheetah                            9.4500    0.0000    9.4500    9.4498
cheetah-create                     9.7400    0.0000    9.7400    9.7356
kid                              169.4400    0.0000  169.4400  169.5022
kid-create                       170.5300    0.0200  170.5500  170.6074
genshi                           102.5700    0.0000  102.5700  102.6323
genshi-create                    201.6100    0.2800  201.8900  202.0769
mako                               2.8600    0.0100    2.8700    2.8641
mako-create                        4.8700    0.1500    5.0200    5.0314
mako-nocache                      70.3000    0.3700   70.6700   70.7403
jinja2                             3.5600    0.0100    3.5700    3.5751
jinja2-create                     82.3000    0.3400   82.6400   82.7155

Python 2.7.2 y GCC 4.5.3

Ver código
                              utime     stime     total      real
tenjin                             2.0600    0.0000    2.0600    2.0543
tenjin-create                      2.7100    0.1000    2.8100    2.8148
tenjin-str                         1.1700    0.0000    1.1700    1.1727
django                            48.1300    0.0000   48.1300   48.1483
django-create                     58.2200    0.1400   58.3600   58.3909
cheetah                            9.4900    0.0000    9.4900    9.4995
cheetah-create                     9.6700    0.0000    9.6700    9.6683
kid                              171.1300    0.0000  171.1300  171.1886
kid-create                       173.3100    0.0300  173.3400  173.4043
genshi                           104.9000    0.0000  104.9000  104.9526
genshi-create                    203.9500    0.2800  204.2300  204.4071
mako                               2.7700    0.0000    2.7700    2.7746
mako-create                        4.6800    0.1600    4.8400    4.8590
mako-nocache                      69.8400    0.3700   70.2100   70.2735
jinja2                             3.5700    0.0100    3.5800    3.5831
jinja2-create                     82.4000    0.3800   82.7800   82.8525

Benchmark basados en el codigo Spitfire performance tests:

Python 2.6.6

Ver código
Genshi tag builder                            308.61 ms
Genshi template                               179.08 ms
Genshi template + tag builder                 338.64 ms
Mako Template                                  39.34 ms
Kid template                                  706.16 ms
Djange template                               371.56 ms
Cheetah template                               42.14 ms
StringIO                                       47.67 ms
cStringIO                                       8.07 ms
list concat                                     5.09 ms

Python 2.7.2

Ver código
Genshi tag builder                            313.95 ms
Genshi template                               172.67 ms
Genshi template + tag builder                 337.62 ms
Mako Template                                  34.99 ms
Kid template                                  702.53 ms
Djange template                               370.30 ms
Cheetah template                               42.43 ms
StringIO                                       46.91 ms
cStringIO                                       7.30 ms
list concat                                     4.90 ms

Python 2.7.2 y GCC 4.5.3

Ver código
Genshi tag builder                            305.27 ms
Genshi template                               180.95 ms
Genshi template + tag builder                 332.87 ms
Mako Template                                  33.85 ms
Kid template                                  712.32 ms
Djange template                               355.89 ms
Cheetah template                               39.50 ms
StringIO                                       45.37 ms
cStringIO                                       6.86 ms
list concat                                     4.66 ms

Como resultado hay que decir que el Python 2.7 es ligeramente mas rápido que su versión anterior la 2.6

Mientras que el cambio de GCC 4.4.6 a 4.5.3 se gana en ciertas partes otras se pierde, aun le faltaran pulir las regresiones.

 

Leer 4941 veces Modificado por última vez en Miércoles, 01 Agosto 2012 12:38

Escribir un comentario


Código de seguridad
Refescar