{"id":15980577,"url":"https://github.com/drwpow/node-dom-parse-benchparks","last_synced_at":"2025-04-04T18:44:42.217Z","repository":{"id":66331306,"uuid":"417705287","full_name":"drwpow/node-dom-parse-benchparks","owner":"drwpow","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-16T05:00:31.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T04:17:26.027Z","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":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drwpow.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}},"created_at":"2021-10-16T03:35:52.000Z","updated_at":"2021-10-26T09:21:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"28e4ff1f-6bfd-401d-8c42-60b52e95ac49","html_url":"https://github.com/drwpow/node-dom-parse-benchparks","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/drwpow%2Fnode-dom-parse-benchparks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fnode-dom-parse-benchparks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fnode-dom-parse-benchparks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fnode-dom-parse-benchparks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drwpow","download_url":"https://codeload.github.com/drwpow/node-dom-parse-benchparks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234850,"owners_count":20905852,"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-08T00:20:49.418Z","updated_at":"2025-04-04T18:44:42.194Z","avatar_url":"https://github.com/drwpow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js DOM performance benchmarks\n\n⚠️ **This is a cheap test!** My usecase was parsing a unique document once, and running a query selector once. This is very different from parsing a document once, and running many, many queries on it.\n\n### Methodology\n\n1. Parse a long document (the GitHub.com homepage, © GitHub)\n2. Query for a specific element, using whatever the parser has available\n3. Repeat 999×\n\n### Results\n\n| Package                                                        |   Result |  Comparison  |\n| :------------------------------------------------------------- | -------: | :----------: |\n| [hypertag](https://npmjs.com/hypertag)                         |  `1.48s` |      —       |\n| [fast-html-parser](https://npmjs.com/fast-html-parser)         |  `1.63s` |  10% slower  |\n| [htmlparser2](https://npmjs.com/htmlparser2)                   |  `3.69s` | 149% slower  |\n| [node-html-parser](https://npmjs.com/node-html-parser)         |  `5.24s` | 254% slower  |\n| [sax-wasm](https://npmjs.com/sax-wasm)\\*                       | `10.82s` | 631% slower  |\n| [cheerio](https://npmjs.com/cheerio)                           | `22.48s` | 1419% slower |\n| [fast-html-dom-parser](https://npmjs.com/fast-html-dom-parser) | `94.48s` | 6284% slower |\n| [jsdom](https://npmjs.com/jsdom)\\*\\*                           |      ??? |              |\n\n\\*I know what you’re thinking—“why is WASM slower?” Like I said, my methodology here was **parsing a document 1,000×.** WASM has a very expensive startup cost that JS doesn’t. I’m sure that once it’s loaded, it would run circles around everything else. So take these benchmarks with a grain of salt if you’re reusing the same document and not throwing it away each time like I was doing.\n\n\\*\\* jsdom ran out of memory after taking at least 30 seconds. I didn’t get to benchmark it, but that told me all I needed to know (dunno what run it was on either).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwpow%2Fnode-dom-parse-benchparks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrwpow%2Fnode-dom-parse-benchparks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwpow%2Fnode-dom-parse-benchparks/lists"}