fenom/docs/benchmark.md
2013-06-28 11:53:53 +04:00

2.6 KiB

Benchmark

To start benchmark run script benchmark/run.php.

Smarty3 vs Twig vs Fenom

PHP 5.4.11

Printing of varaibles

 smarty3: !compiled and !loaded      8.7919 sec,       21.1 MiB
 smarty3:  compiled and !loaded      0.0341 sec,       16.4 MiB
 smarty3:  compiled and  loaded      0.0028 sec,       16.4 MiB

    twig: !compiled and !loaded      3.9040 sec,       67.5 MiB
    twig:  compiled and !loaded      0.0337 sec,       16.1 MiB
    twig:  compiled and  loaded      0.0027 sec,       16.1 MiB

   fenom: !compiled and !loaded      1.0142 sec,        8.8 MiB
   fenom:  compiled and !loaded      0.0167 sec,        6.1 MiB
   fenom:  compiled and  loaded      0.0024 sec,        6.1 MiB

Iterating of array ({foreach})

 smarty3: !compiled and !loaded      0.0369 sec,        5.7 MiB
 smarty3:  compiled and !loaded      0.0048 sec,        3.1 MiB
 smarty3:  compiled and  loaded      0.0039 sec,        3.1 MiB

    twig: !compiled and !loaded      0.0810 sec,        4.3 MiB
    twig:  compiled and !loaded      0.0605 sec,        2.9 MiB
    twig:  compiled and  loaded      0.0550 sec,        2.9 MiB

   fenom: !compiled and !loaded      0.0093 sec,        3.0 MiB
   fenom:  compiled and !loaded      0.0033 sec,        2.4 MiB
   fenom:  compiled and  loaded      0.0027 sec,        2.4 MiB

Inheriting of templates ({extends})

 smarty3: !compiled and !loaded      0.6374 sec,        9.8 MiB
 smarty3:  compiled and !loaded      0.0009 sec,        3.0 MiB
 smarty3:  compiled and  loaded      0.0001 sec,        3.0 MiB

    twig: !compiled and !loaded      0.5568 sec,       11.1 MiB
    twig:  compiled and !loaded      0.0255 sec,        6.3 MiB
    twig:  compiled and  loaded      0.0038 sec,        6.3 MiB

   fenom: !compiled and !loaded      0.1222 sec,        3.9 MiB
   fenom:  compiled and !loaded      0.0004 sec,        2.4 MiB
   fenom:  compiled and  loaded      0.0000 sec,        2.4 MiB
  • !compiled and !loaded - template engine object created but parsers not initialized and templates not compiled
  • compiled and !loaded - template engine object created, template compiled but not loaded
  • compiled and loaded - template engine object created, template compiled and loaded

Stats

Template Engine Files Classes Lines
Smarty3 (3.1.13) 320 190 55095
Twig (1.13.0) 162 131 13908
Fenom (1.0.1) 9 16 3899