{"id":20048345,"url":"https://github.com/paramdeo/testing-imperative-loops-versus-higher-order-functions-in-javascript","last_synced_at":"2026-05-31T20:31:52.700Z","repository":{"id":172558268,"uuid":"649435264","full_name":"paramdeo/testing-imperative-loops-versus-higher-order-functions-in-javascript","owner":"paramdeo","description":"Testing an Imperative Loop versus Higher Order Functions in JavaScript","archived":false,"fork":false,"pushed_at":"2023-06-04T21:18:25.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T08:23:48.574Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paramdeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-06-04T20:38:17.000Z","updated_at":"2023-06-04T21:15:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"3444643d-27e4-40ea-850f-58aaa0d9da5b","html_url":"https://github.com/paramdeo/testing-imperative-loops-versus-higher-order-functions-in-javascript","commit_stats":null,"previous_names":["paramdeo/codesandbox-jh1msd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paramdeo/testing-imperative-loops-versus-higher-order-functions-in-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paramdeo","download_url":"https://codeload.github.com/paramdeo/testing-imperative-loops-versus-higher-order-functions-in-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33748607,"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-05-31T02:00:06.040Z","response_time":95,"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":"2024-11-13T11:43:04.082Z","updated_at":"2026-05-31T20:31:52.679Z","avatar_url":"https://github.com/paramdeo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing an Imperative Loop vs Higher-Order Functions in JavaScript\n\nRun `npm run test` in the console for a preset benchmark that includes a warmup run for the garbage collector to wake up. The test runs against the following data:\n\n- 1,000,000 Elements of Value 100\n- 10,000,000 Elements of Value 250\n- 12,345,678 Elements of Value 1337\n- 25,000,000 Elements of Value 500\n\nTo run against custom data, run `node index.js 5000 50` where `5000` is the size of the array and `50` is the integer value of each element.\n\n\u003e Note: The benchmarks are done via summing all the elements in the array.\n\u003e\n\u003e Also Note: Testing array sizes above 25 million elements sends the CPU usage above 90%, causing the VM to hang. Don't be a dick to the generous folks at CodeSandbox.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparamdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamdeo%2Ftesting-imperative-loops-versus-higher-order-functions-in-javascript/lists"}