{"id":20838837,"url":"https://github.com/royalicing/browser-workout","last_synced_at":"2025-03-12T10:09:10.096Z","repository":{"id":72483341,"uuid":"428476917","full_name":"RoyalIcing/browser-workout","owner":"RoyalIcing","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-05T10:48:26.000Z","size":62,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-18T23:44:09.738Z","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/RoyalIcing.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}},"created_at":"2021-11-16T01:27:58.000Z","updated_at":"2023-03-05T06:33:50.000Z","dependencies_parsed_at":"2023-03-11T13:23:41.360Z","dependency_job_id":null,"html_url":"https://github.com/RoyalIcing/browser-workout","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/RoyalIcing%2Fbrowser-workout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fbrowser-workout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fbrowser-workout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fbrowser-workout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyalIcing","download_url":"https://codeload.github.com/RoyalIcing/browser-workout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196663,"owners_count":20251861,"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-18T01:11:40.147Z","updated_at":"2025-03-12T10:09:10.075Z","avatar_url":"https://github.com/RoyalIcing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Benchmarking common JavaScript operations across browsers\n\nInstall:\n\n```bash\nnpm ci\nnpx playwright install\n```\n\nTo run the benchmarks:\n\n```bash\nnpm t\n```\n\nResults from running in GitHub Actions:\n\n```\n# Chromium\nArray.prototype.some x 78.59 ops/sec ±0.16% (58 runs sampled)\nfor i++ loop x 1,500 ops/sec ±0.19% (65 runs sampled)\nfor of loop x 601 ops/sec ±0.16% (66 runs sampled)\ncount evens with .filter().length x 45.56 ops/sec ±4.01% (49 runs sampled)\ncount evens with for i++ loop x 596 ops/sec ±0.16% (67 runs sampled)\ncount evens with for of loop x 534 ops/sec ±0.21% (64 runs sampled)\nMath.max(...) x 26,940 ops/sec ±0.16% (68 runs sampled)\nreduce(Math.max) x 10,564 ops/sec ±21.20% (65 runs sampled)\njoin strings with reduce(a + b) x 10.22 ops/sec ±5.41% (29 runs sampled)\njoin strings with .join() x 21.75 ops/sec ±6.39% (40 runs sampled)\njoin numbers with reduce(a + b) x 4.49 ops/sec ±8.92% (15 runs sampled)\njoin numbers with .join() x 4.91 ops/sec ±12.02% (17 runs sampled)\njoin numbers with .map().join() x 4.67 ops/sec ±3.92% (16 runs sampled)\n\n# Firefox\nArray.prototype.some x 125 ops/sec ±0.35% (58 runs sampled)\nfor i++ loop x 155 ops/sec ±0.43% (61 runs sampled)\nfor of loop x 90.28 ops/sec ±0.36% (58 runs sampled)\ncount evens with .filter().length x 76.49 ops/sec ±2.52% (50 runs sampled)\ncount evens with for i++ loop x 367 ops/sec ±0.22% (65 runs sampled)\ncount evens with for of loop x 108 ops/sec ±0.25% (56 runs sampled)\nMath.max(...) x 15,791 ops/sec ±12.69% (46 runs sampled)\nreduce(Math.max) x 4,859 ops/sec ±43.08% (28 runs sampled)\njoin strings with reduce(a + b) x 23.19 ops/sec ±7.99% (28 runs sampled)\njoin strings with .join() x 51.28 ops/sec ±3.06% (45 runs sampled)\njoin numbers with reduce(a + b) x 9.82 ops/sec ±8.88% (21 runs sampled)\njoin numbers with .join() x 34.80 ops/sec ±2.24% (46 runs sampled)\njoin numbers with .map().join() x 10.86 ops/sec ±6.53% (30 runs sampled)\n\n# WebKit\nArray.prototype.some x 419 ops/sec ±10.16% (55 runs sampled)\nfor i++ loop x 752 ops/sec ±0.08% (51 runs sampled)\nfor of loop x 366 ops/sec ±5.28% (64 runs sampled)\ncount evens with .filter().length x 158 ops/sec ±4.62% (59 runs sampled)\ncount evens with for i++ loop x 541 ops/sec ±0.14% (65 runs sampled)\ncount evens with for of loop x 284 ops/sec ±0.16% (63 runs sampled)\nMath.max(...) x 18,468 ops/sec ±1.79% (66 runs sampled)\nreduce(Math.max) x 59,233 ops/sec ±0.27% (66 runs sampled)\njoin strings with reduce(a + b) x 33.63 ops/sec ±7.32% (37 runs sampled)\njoin strings with .join() x 38.07 ops/sec ±1.04% (50 runs sampled)\njoin numbers with reduce(a + b) x 10.47 ops/sec ±6.67% (23 runs sampled)\njoin numbers with .join() x 16.18 ops/sec ±0.65% (31 runs sampled)\njoin numbers with .map().join() x 6.03 ops/sec ±45.12% (24 runs sampled)\n```\n\nResults from MacBook Pro M1 Pro on Low Power Mode:\n\n```\n  ✓  [chromium] › bench.spec.js:3:1 › Run benchmarks (28s)\nArray.prototype.some x 130 ops/sec ±0.15% (63 runs sampled)\nfor i++ loop x 1,348 ops/sec ±0.44% (64 runs sampled)\nfor of loop x 897 ops/sec ±0.16% (68 runs sampled)\nMath.max(...) x 55,741 ops/sec ±1.81% (68 runs sampled)\nreduce(Math.max) x 34,120 ops/sec ±34.43% (65 runs sampled)\n\n  ✓  [firefox] › bench.spec.js:3:1 › Run benchmarks (28s)\nArray.prototype.some x 264 ops/sec ±0.26% (54 runs sampled)\nfor i++ loop x 275 ops/sec ±0.21% (66 runs sampled)\nfor of loop x 175 ops/sec ±0.20% (62 runs sampled)\nMath.max(...) x 47,678 ops/sec ±0.21% (68 runs sampled)\nreduce(Math.max) x 6,564 ops/sec ±48.98% (29 runs sampled)\n\n  ✓  [webkit] › bench.spec.js:3:1 › Run benchmarks (28s)\nArray.prototype.some x 549 ops/sec ±17.00% (49 runs sampled)\nfor i++ loop x 1,775 ops/sec ±0.19% (69 runs sampled)\nfor of loop x 548 ops/sec ±0.17% (67 runs sampled)\nMath.max(...) x 36,006 ops/sec ±0.44% (67 runs sampled)\nreduce(Math.max) x 66,401 ops/sec ±0.16% (68 runs sampled)\n```\n\n## Thanks\n\n- Forked from Adrian Lowdon’s work: https://javascript.plainenglish.io/using-playwright-and-benchmark-js-to-test-javascript-performance-across-browsers-99fc0dc56e55 https://gist.github.com/alowdon/0580047afb245a2c462c962b02a685a3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fbrowser-workout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyalicing%2Fbrowser-workout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fbrowser-workout/lists"}