{"id":18417811,"url":"https://github.com/danieljdufour/fast-min","last_synced_at":"2025-04-13T05:24:16.751Z","repository":{"id":57233033,"uuid":"312441692","full_name":"DanielJDufour/fast-min","owner":"DanielJDufour","description":"🔥 The Quickest Way to get the Minimum Value of an Array of Numbers (Typed or Untyped)","archived":false,"fork":false,"pushed_at":"2024-01-14T02:52:17.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T08:45:31.260Z","etag":null,"topics":["math","minimum","stats"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielJDufour.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":"2020-11-13T01:36:03.000Z","updated_at":"2022-10-26T21:28:43.000Z","dependencies_parsed_at":"2024-06-20T21:59:22.149Z","dependency_job_id":"9418cc76-b576-4dae-9b0b-f69002e9439e","html_url":"https://github.com/DanielJDufour/fast-min","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielJDufour%2Ffast-min","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielJDufour%2Ffast-min/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielJDufour%2Ffast-min/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielJDufour%2Ffast-min/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielJDufour","download_url":"https://codeload.github.com/DanielJDufour/fast-min/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248667024,"owners_count":21142359,"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":["math","minimum","stats"],"created_at":"2024-11-06T04:11:27.322Z","updated_at":"2025-04-13T05:24:16.731Z","avatar_url":"https://github.com/DanielJDufour.png","language":"JavaScript","readme":"# fast-min\n:fire: The Quickest Way to get the Minimum Value of an Array of Numbers (Typed or Untyped)\n\n# install\n```\nnpm install fast-min\n```\n\n# why is it so much faster?\nThis library excels with typed arrays.  It takes into account the theoretical minimum of a typed array.\nFor example, if you have a  Uint8Array, it's not possible for a minimum value to be less than zero,\nso if we encounter a 0 in the array, we can stop searching for the minimum value.\n\n# usage\n# getting minimum value of a normal array\n```javascript\nimport fastMin from 'fast-min';\n\nconst result = fastMin([0, -1, -2, -3, -4, -5]);\n// result is -5\n```\n\n# getting minimum value of a typed array\n```javascript\nimport fastMin from 'fast-min';\n\nconst pixel_values = Uint8Array.from([0, 128, 255, 34, ...]);\nconst result = fastMin(pixel_values);\n// result is 0\n```\n\n# no data value\nIf you want to ignore one or more specific values, you can set the no_data value.\n```javascript\nimport fastMin from 'fast-min';\n\nconst numbers = [99, 0, 7, 99, 5, ...];\nconst result = fastMin(numbers, { no_data: 0 });\n// result is 5\n\nconst result = fastMax(numbers, { no_data: [5, 99] });\n// result is now 7\n```\n\n# performance tests\nHere are test results comparing fast-min to two other popular libraries underscore and lodash.\nTests have been conducted by creating an array of ten million random numbers from the lowest to the highest theoretical value of the typed array.\n| array type | library | average duration in milliseconds |\n| ---------- | ------- | -------------------------------- |\n| Int8Array | fast-min | **0.1** | \n| Int8Array | lodash | 23.2 | \n| Int8Array | underscore | 10.3 | \n| Uint8Array | fast-min | **\u003c 1** | \n| Uint8Array | lodash | 23.2 | \n| Uint8Array | underscore | 10.3 | \n| Int16Array | fast-min | **0.4** | \n| Int16Array | lodash | 23.5 | \n| Int16Array | underscore | 10.4 | \n| Uint16Array | fast-min | **0.8** | \n| Uint16Array | lodash | 23.5 | \n| Uint16Array | underscore | 10.6 | \n| Int32Array | fast-min | **65.6** | \n| Int32Array | lodash | 23.5 | \n| Int32Array | underscore | 11 | \n| Uint32Array | fast-min | **139.7** | \n| Uint32Array | lodash | 27.2 | \n| Uint32Array | underscore | 16.4 | \n| BigInt64Array | fast-min | **56.1** | \n| BigInt64Array | lodash | 78.8 | \n| BigInt64Array | underscore | 63.9 | \n| BigUint64Array | fast-min | **55.9** | \n| BigUint64Array | lodash | 122.1 | \n| BigUint64Array | underscore | 114.9 | \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieljdufour%2Ffast-min","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieljdufour%2Ffast-min","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieljdufour%2Ffast-min/lists"}