{"id":15688316,"url":"https://github.com/zordius/handlebarstest","last_synced_at":"2025-05-07T21:03:14.576Z","repository":{"id":6243630,"uuid":"7475804","full_name":"zordius/HandlebarsTest","owner":"zordius","description":"Performance tests on Mustache and Handlebars php libs","archived":false,"fork":false,"pushed_at":"2022-03-22T00:26:25.000Z","size":27658,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T21:02:52.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zordius.github.io/HandlebarsTest/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mabrowning/minecrift","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zordius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-07T02:40:06.000Z","updated_at":"2022-03-21T13:20:15.000Z","dependencies_parsed_at":"2022-09-04T10:21:03.521Z","dependency_job_id":null,"html_url":"https://github.com/zordius/HandlebarsTest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2FHandlebarsTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2FHandlebarsTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2FHandlebarsTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2FHandlebarsTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zordius","download_url":"https://codeload.github.com/zordius/HandlebarsTest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954409,"owners_count":21830902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:57:49.690Z","updated_at":"2025-05-07T21:03:14.549Z","avatar_url":"https://github.com/zordius.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"HandlebarsTest\n==============\n\n[![Regression testing](https://github.com//zordius/HandlebarsTest/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/zordius/HandlebarsTest/actions/workflows/php.yml) tested PHP: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0\n\nPerformance tests on Mustache and Handlebars php libs. Results can be found here: http://zordius.github.io/HandlebarsTest/ .\n\nPerformance results done by others:\n\n* https://github.com/gwicke/TemplatePerf\n\nCurrent Result\n--------------\n\nCheck the live chart (performance comparison) for more details: http://zordius.github.io/HandlebarsTest/\n\nRequirements\n------------\n\n* php 5.3+\n\n* [optional] nodejs04+ and handlebars for fixture generation. (See \u003ca href=\"#how-to-test\"\u003eHow to test\u003c/a\u003e)\n\nQuick Conclusion\n----------------\n\u003cb\u003eUse https://github.com/zordius/lightncandy to compile handlebars in php, because:\u003c/b\u003e\n\n* it runs 2~7 times faster than https://github.com/bobthecow/mustache.php\n* it runs 2~7 times faster than https://github.com/dingram/mustache-php\n* it runs 10~50 times faster than https://github.com/XaminProject/handlebars.php\n\nDetail reports please browse the 'report' directory.\n\nLibraries\n---------\n\nTesting targets:\n\n* pure php template with logic commands.\n* Mustache.php https://github.com/bobthecow/mustache.php\n* mustache-php https://github.com/dingram/mustache-php\n* Handlebars.php https://github.com/XaminProject/handlebars.php\n* lightncandy https://github.com/zordius/lightncandy\n\nTesting data and templates:\n\n* some fixtures are converted from https://github.com/bobthecow/mustache.php/tree/master/test/fixtures/examples\n\nDirectories\n-----------\n\n* *cloned*: all cloned library files are placed here.\n* *fixture*: all data files for testing are placed here:\n   * .json : testing data files in json format\n   * .tmpl : testing template files\n   * .txt  : correct results and library outputs\n   * .php  : lightncandy generated php template\n* *inc*: all required php lib files are placed here.\n* *bin*: all testing scripts and commands are placed here.\n* *report*: all reports generated by bin/hbreport are placed here, in different format.\n\nFeature Comparison\n------------------\n\u003ca href=\"FEATURES.md\"\u003e\u003cimg src=\"features.png\"\u003e\u003c/a\u003e\n\nHow to Test\n-----------\n\n* Prepare:\n```sh\ngit submodule init\ngit submodule update\n```\n\n1. install nodejs04+\n2. install npm\n3. install handlebars: `npm install handlebars`\n4. `bin/generate-fixture`\n   * This will generate *.txt files under fixtures.\n   * These files are generated with handlebars.js.\n   * All tests will use these txt files as standard answers.\n\n* single lib test\n   * bin/hbtest libName testFile [testTimes]\n   * libName can be one of: none , lightncandy , handlebars.php , mustache-php , mustache.php\n   * 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.\n   * Example: bin/hbtest mustache.php fixture/001-simple-vars-001.json\n\n* feature test\n   * all tests will be executed with FLAG_HANDLEBARS on (turn on all handlebars extensions on mustache)\n   * Thest tests do not generate any file under report/\n   * After test end, a feature chart will be outputed on console.\n   * bin/hbreport 5\n      * lightncandy will be executed with FLAG_JS enabled\n   * bin/hbreport 7\n      * lightncandy will be executed with FLAG_JS and FLAG_STANDALONE enabled.\n   * bin/hbreport 1\n      * lightncandy will be executed with FLAG_JS, FLAG_STANDALONE and FLAG_ECHO enabled (to know more about FLAG_BESTPERFORMANCE, read lightncandy document please)\n   * bin/hbreport F num_of_know_issue\n      * only test on lightncandy\n      * exit with (number of detected issues - number of know issues)\n\n* performance test\n   * bin/hbreport\n      * This will generate report files under report/\n      * default test 100000 times on every cases and libs, takes very long time.\n   * bin/hbreport L\n      * This will generate report files under report/versions*.json\n      * Tests on every release/version of lightncandy.\n      * test 10000 times on every cases.\n      * Go http://zordius.github.io/HandlebarsTest/versions.html to see results as chart.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fhandlebarstest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzordius%2Fhandlebarstest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fhandlebarstest/lists"}