{"id":21405415,"url":"https://github.com/karimsa/bench-js-parsers","last_synced_at":"2026-05-19T11:05:02.250Z","repository":{"id":43783787,"uuid":"226394845","full_name":"karimsa/bench-js-parsers","owner":"karimsa","description":"Some benchmarks to show the performance of various modern JS parsers.","archived":false,"fork":false,"pushed_at":"2022-02-18T16:54:03.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T21:03:57.975Z","etag":null,"topics":["acorn","babel","benchmark","esprima","javascript","parser","performance"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/karimsa.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":"2019-12-06T19:22:46.000Z","updated_at":"2022-02-18T16:54:37.000Z","dependencies_parsed_at":"2022-08-21T14:20:32.352Z","dependency_job_id":null,"html_url":"https://github.com/karimsa/bench-js-parsers","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/karimsa%2Fbench-js-parsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fbench-js-parsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fbench-js-parsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fbench-js-parsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karimsa","download_url":"https://codeload.github.com/karimsa/bench-js-parsers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902293,"owners_count":20366259,"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":["acorn","babel","benchmark","esprima","javascript","parser","performance"],"created_at":"2024-11-22T16:25:16.431Z","updated_at":"2026-05-19T11:04:57.218Z","avatar_url":"https://github.com/karimsa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bench-js-parsers\n\nSome benchmarks to show the performance of various JS parsers.\n\nSpecifically, I wanted to compare two features:\n\n * Being able to generate an AST (as a baseline test)\n * Being able to traverse the given AST recursively to perform basic static analysis\n\nThe benchmark code does not enable any helper features for the traversal in any of the\nparsers such as scope computation or ancestor gathering. It assumes that these are either\nnot needed or can be implemented in the userland code.\n\n## Benchmarks\n\nThese are the benchmark results on my machine, which is a MacBook Air Early 2015 with a 2.2 GHz Intel i7.\nThe purpose is not to take the specific numbers seriously but rather to compare the different parsers at\norders of magnitude (assuming that two parsers with results that are within the same order of magnitude\nare relatively equally performant).\n\n*Note: newlines have been added in the output to make it easier to read.*\n\n```\n\n\u003e @ benchmark /Users/karimsa/projects/bench-js-parsers\n\u003e wiz bench \"--benchTime\" \"5000000\"\n\nTargets:\n  - bootstrap.min.js:\n        Hash: 61f338f870fcd0ff46362ef109d28533\n        Size: 60010 bytes\n  - jquery.min.js:\n        Hash: 220afd743d9e9643852e31a135a9f3ae\n        Size: 88145 bytes\n  - react.development.js:\n        Hash: 5096de8b459ac09462a481b55b4af8c0\n        Size: 74430 bytes\n  - app.jsx (todomvc):\n        Hash: eb7765b55e8ffdab46d93e183c381227\n        Size: 3940 bytes\n\n        parse: app.jsx (todomvc) - @babel/parser        762 ops/s     6.2 ms/op \n        parse: app.jsx (todomvc) - acorn              1 609 ops/s     5.8 ms/op \n        parse: app.jsx (todomvc) - esprima            1 980 ops/s     4.4 ms/op \n        parse: app.jsx (todomvc) - meriyah            4 574 ops/s     3.3 ms/op \n\n        parse: bootstrap.min.js - @babel/parser          41 ops/s    32.9 ms/op \n        parse: bootstrap.min.js - acorn                  75 ops/s    26.9 ms/op \n        parse: bootstrap.min.js - esprima                50 ops/s    32.7 ms/op \n        parse: bootstrap.min.js - meriyah               261 ops/s    11.1 ms/op \n\n        parse: jquery.min.js - @babel/parser             22 ops/s      48 ms/op \n        parse: jquery.min.js - acorn                     40 ops/s    31.4 ms/op \n        parse: jquery.min.js - esprima                   29 ops/s      38 ms/op \n        parse: jquery.min.js - meriyah                  133 ops/s    16.5 ms/op \n\n        parse: react.development.js - @babel/parser      88 ops/s    26.6 ms/op \n        parse: react.development.js - acorn             204 ops/s     5.6 ms/op \n        parse: react.development.js - esprima           134 ops/s     7.9 ms/op \n        parse: react.development.js - meriyah           407 ops/s     2.9 ms/op \n\n        walk: app.jsx (todomvc) - @babel/parser         187 ops/s    10.1 ms/op \n        walk: app.jsx (todomvc) - acorn               1 276 ops/s     3.5 ms/op \n        walk: app.jsx (todomvc) - esprima               927 ops/s     2.4 ms/op \n        walk: app.jsx (todomvc) - meriyah             2 914 ops/s     1.1 ms/op \n\n        walk: bootstrap.min.js - @babel/parser            9 ops/s   103.7 ms/op \n        walk: bootstrap.min.js - acorn                   53 ops/s    42.5 ms/op \n        walk: bootstrap.min.js - esprima                 63 ops/s      16 ms/op \n        walk: bootstrap.min.js - meriyah                145 ops/s     7.3 ms/op \n\n        walk: jquery.min.js - @babel/parser               5 ops/s   195.2 ms/op \n        walk: jquery.min.js - acorn                      27 ops/s    61.2 ms/op \n        walk: jquery.min.js - esprima                    24 ops/s    54.5 ms/op \n        walk: jquery.min.js - meriyah                    86 ops/s    11.6 ms/op \n\n        walk: react.development.js - @babel/parser       26 ops/s    38.4 ms/op \n        walk: react.development.js - acorn              113 ops/s    31.5 ms/op \n        walk: react.development.js - esprima            149 ops/s     6.8 ms/op \n        walk: react.development.js - meriyah            296 ops/s     3.4 ms/op \n\nbench: 12m\n```\n\n## License\n\nLicensed under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fbench-js-parsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarimsa%2Fbench-js-parsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fbench-js-parsers/lists"}