{"id":21948771,"url":"https://github.com/nemtsov/hogan_vs_mu_bench","last_synced_at":"2026-04-29T02:43:12.576Z","repository":{"id":3688467,"uuid":"4758761","full_name":"nemtsov/hogan_vs_mu_bench","owner":"nemtsov","description":"Siege.js-based benchmark of Hogan.js vs Mu for small \u0026 large files.","archived":false,"fork":false,"pushed_at":"2012-06-23T19:52:15.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T00:03:33.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bigspaceship/shine.js","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemtsov.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":"2012-06-23T05:49:00.000Z","updated_at":"2019-09-25T18:43:47.000Z","dependencies_parsed_at":"2022-08-20T16:30:37.918Z","dependency_job_id":null,"html_url":"https://github.com/nemtsov/hogan_vs_mu_bench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nemtsov/hogan_vs_mu_bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Fhogan_vs_mu_bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Fhogan_vs_mu_bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Fhogan_vs_mu_bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Fhogan_vs_mu_bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemtsov","download_url":"https://codeload.github.com/nemtsov/hogan_vs_mu_bench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Fhogan_vs_mu_bench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263234936,"owners_count":23434916,"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-11-29T05:17:45.924Z","updated_at":"2026-04-29T02:43:07.555Z","avatar_url":"https://github.com/nemtsov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hogan.js vs Mu Bench\n====================\n\nSimple [siege.js](https://github.com/kissjs/siege.js)-based benchmark of \n[Hogan.js](https://github.com/twitter/hogan.js) vs [Mu](https://github.com/raycmorgan/Mu).\n\n\nMotivation\n----------\n\nI'm in the process of optimizing a mustache template compiler / renderer for a Node.js web application. \nHaving successfully used Hogan.js in the past for in-browser templating, I decided to use Hogan as the \ntemplating engine on the back-end.\n\nAs part of the integration tests, I run a set of siege.js ('apache-bench'-like) benchmarks. At first, \nthe results were good, but as I added more content to the pages, I noticed that the requests per \nsecond (rps) dropped a great deal more than expected. After spending some time profiling the app \n(btw, [node-webkit-agent](https://github.com/c4milo/node-webkit-agent) is a great tool for that) \nit looked as though the GC was taking significantly more time than anything else.\n\nThat got me thinking that rendering the whole page as a string, sending that string to the client, \nand then leaving that 200K string for the GC to clean-up on every single request is probably a bit \nwasteful. So, I started looking for a Mustache compiler that will be able to stream the data out \nto the user in chunks. Having found Mu, I needed a more-or-less clean benchmark comparing the two, \nwhich is what this repo is.\n\n\nInitial Observations\n--------------------\n\nHogan.js is (2x) more efficient at rendering *smaller* (148B) templates. Mu is \nsignificantly (4x) more efficient at rendering *larger* (226K [wsj.com homepage]) \ntemplates.\n\n\nTo Execute\n----------\n\n    npm install                  # install hogan.js \u0026 mu\n    node hogan_vs_mu_server.js   # start the server\n    ./bench.sh                   # begin the benchmark\n\n\nAverages (5 runs, MBP 2.53Ghz, 8G RAM)\n--------------------------------------\n\nSmall (148B) Template\n\n    /hogan-mini { rps: 6552, responseInMs: { min: 6, max:  92, avg: 30 } }\n       /mu-mini { rps: 3135, responseInMs: { min: 6, max: 240, avg: 64 } }\n\nLarge (226K) Template\n\n    /hogan { rps:  313, responseInMs: { min: 212, max: 3671, avg: 639 } }\n       /mu { rps: 1185, responseInMs: { min:  11, max: 2564, avg: 169 } }\n\n\n\nRaw Data\n--------\n\nNotes: \n  Taken on a MacBook Pro 2.53 GHz Intel Core 2 Duo, 8GB RAM.\n  request-iterations: 100000, concurrent users: 200, test-iterations: 5\n\n    /hogan-mini\n      rps: 6569, 6437, 6379, 6397, 6980\n      response: 4ms(min)\t71ms(max)\t30ms(avg)\n      response: 3ms(min)\t74ms(max)\t31ms(avg)\n      response: 5ms(min)\t127ms(max)\t31ms(avg)\n      response: 17ms(min)\t93ms(max)\t31ms(avg)\n      response: 2ms(min)\t94ms(max)\t28ms(avg)\n\n    /mu-mini\n      rps: 3277, 2960, 3113, 3150, 3173\n      response: 7ms(min)\t131ms(max)\t61ms(avg)\n      response: 2ms(min)\t314ms(max)\t67ms(avg)\n      response: 8ms(min)\t238ms(max)\t64ms(avg)\n      response: 8ms(min)\t278ms(max)\t63ms(avg)\n      response: 5ms(min)    269ms(max)\t60ms(avg)\n\n    /hogan\n      rps: 311, 302, 312, 316, 326\n      response: 480ms(min)\t6534ms(max)\t643ms(avg)\n      response: 50ms(min)\t1619ms(max)\t663ms(avg)\n      response: 51ms(min)\t1258ms(max)\t640ms(avg)\n      response: 444ms(min)\t7008ms(max)\t634ms(avg)\n      response: 39ms(min)\t1935ms(max)\t614ms(avg)\n      \n    /mu\n      rps: 1268, 1169, 1200, 1085, 1201\n      response: 8ms(min)\t517ms(max)\t157ms(avg)\n      response: 19ms(min)\t5579ms(max)\t171ms(avg)\n      response: 8ms(min)\t5520ms(max)\t166ms(avg)\n      response: 10ms(min)\t725ms(max)\t184ms(avg)\n      response: 9ms(min)\t480ms(max)\t166ms(avg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemtsov%2Fhogan_vs_mu_bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemtsov%2Fhogan_vs_mu_bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemtsov%2Fhogan_vs_mu_bench/lists"}