Skip to content

zordius/HandlebarsTest

Repository files navigation

HandlebarsTest

Regression testing tested PHP: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0

Performance tests on Mustache and Handlebars php libs. Results can be found here: http://zordius.github.io/HandlebarsTest/ .

Performance results done by others:

Current Result

Check the live chart (performance comparison) for more details: http://zordius.github.io/HandlebarsTest/

Requirements

  • php 5.3+

  • [optional] nodejs04+ and handlebars for fixture generation. (See How to test)

Quick Conclusion

Use https://github.com/zordius/lightncandy to compile handlebars in php, because:

Detail reports please browse the 'report' directory.

Libraries

Testing targets:

Testing data and templates:

Directories

  • cloned: all cloned library files are placed here.
  • fixture: all data files for testing are placed here:
    • .json : testing data files in json format
    • .tmpl : testing template files
    • .txt : correct results and library outputs
    • .php : lightncandy generated php template
  • inc: all required php lib files are placed here.
  • bin: all testing scripts and commands are placed here.
  • report: all reports generated by bin/hbreport are placed here, in different format.

Feature Comparison

How to Test

  • Prepare:
git submodule init
git submodule update
  1. install nodejs04+
  2. install npm
  3. install handlebars: npm install handlebars
  4. bin/generate-fixture
    • This will generate *.txt files under fixtures.
    • These files are generated with handlebars.js.
    • All tests will use these txt files as standard answers.
  • single lib test

    • bin/hbtest libName testFile [testTimes]
    • libName can be one of: none , lightncandy , handlebars.php , mustache-php , mustache.php
    • testTimes default 100000. When testing on lightncandy, testTimes as even times will testing as best performance, testTimes as odd times will testing as best features.
    • Example: bin/hbtest mustache.php fixture/001-simple-vars-001.json
  • feature test

    • all tests will be executed with FLAG_HANDLEBARS on (turn on all handlebars extensions on mustache)
    • Thest tests do not generate any file under report/
    • After test end, a feature chart will be outputed on console.
    • bin/hbreport 5
      • lightncandy will be executed with FLAG_JS enabled
    • bin/hbreport 7
      • lightncandy will be executed with FLAG_JS and FLAG_STANDALONE enabled.
    • bin/hbreport 1
      • lightncandy will be executed with FLAG_JS, FLAG_STANDALONE and FLAG_ECHO enabled (to know more about FLAG_BESTPERFORMANCE, read lightncandy document please)
    • bin/hbreport F num_of_know_issue
      • only test on lightncandy
      • exit with (number of detected issues - number of know issues)
  • performance test

    • bin/hbreport
      • This will generate report files under report/
      • default test 100000 times on every cases and libs, takes very long time.
    • bin/hbreport L

About

Performance tests on Mustache and Handlebars php libs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published