{"id":50531748,"url":"https://github.com/stopsopa/template-engines-benchmark","last_synced_at":"2026-06-03T14:02:54.289Z","repository":{"id":349641965,"uuid":"1203246980","full_name":"stopsopa/template-engines-benchmark","owner":"stopsopa","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-06T23:13:34.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T23:24:59.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stopsopa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T21:38:06.000Z","updated_at":"2026-04-06T23:13:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stopsopa/template-engines-benchmark","commit_stats":null,"previous_names":["stopsopa/template-engines-benchmark"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/stopsopa/template-engines-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Ftemplate-engines-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Ftemplate-engines-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Ftemplate-engines-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Ftemplate-engines-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stopsopa","download_url":"https://codeload.github.com/stopsopa/template-engines-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stopsopa%2Ftemplate-engines-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33867808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-06-03T14:02:53.293Z","updated_at":"2026-06-03T14:02:54.283Z","avatar_url":"https://github.com/stopsopa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Template Engines Benchmark\n\nA performance-oriented experiment focused on benchmarking various JavaScript template engines and documenting critical findings. This repository aims to identify the fastest and simplest solutions, with a deep dive into optimization techniques like the Lodash `variable` option.\n\n## 🚀 Key Findings\n\nIt turns out that **Lodash can be the fastest engine here**, which is pretty surprising.\n\nThe secret is the `variable` option. Normally, Lodash is slow because it uses an old `with` block. By turning on `variable`, you skip that and get a **3.5x speed boost**, putting Lodash at the top of the list.\n\n```javascript\n// Slow: uses 'with' (not recommended)\n_.template(\"our template\");\n\n// Fast: 3.5x performance gain\n_.template(\"our template\", { variable: \"data\" });\n```\n\nInconvenient aspect of that is that we have to always use :\n\n```js\n\n\u003c%= data.name %\u003e\n\n// instead of:\n\n\u003c%= name %\u003e\n\n// which forces us to do:\n\nconst tmp = _.template('Hello \u003c%= data.name %\u003e', { variable: 'data' });\n\nconst html = tmp({ name: 'John' });\n\n// instead of:\n\nconst tmp = _.template('Hello \u003c%= name %\u003e'); // \u003c- shorter\n\nconst html = tmp({ name: 'John' });\n\n```\n\nRecomendation would be to define single letter variable:\n\n```js\nconst tmp = _.template(\"Hello \u003c%= d.name %\u003e\", { variable: \"d\" });\n\nconst html = tmp({ name: \"John\" });\n```\n\n.. that should make it more reasonable/convenient to use.\n\n## 📊 Details \u0026 results\n\n- 📝 **[benchmark/summary.log](benchmark/summary.log)**: The latest raw results from our automated benchmark runs.\n- 📖 **[benchmark/README.md](benchmark/README.md)**: Detailed analysis and conclusions regarding the results.\n- ⚙️ **Manual Workflow**: This benchmark can be triggered manually via GitHub Actions to verify performance across different environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstopsopa%2Ftemplate-engines-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstopsopa%2Ftemplate-engines-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstopsopa%2Ftemplate-engines-benchmark/lists"}