{"id":29959891,"url":"https://github.com/hansalemaos/npfastsortcpp","last_synced_at":"2026-04-17T10:05:11.567Z","repository":{"id":65637774,"uuid":"596302458","full_name":"hansalemaos/npfastsortcpp","owner":"hansalemaos","description":"Sorts int/float 4x faster than numpy by using parallel_sort from C++ (Windows only)","archived":false,"fork":false,"pushed_at":"2023-02-01T22:16:58.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T00:50:43.408Z","etag":null,"topics":["cpp","fast","numpy","python","sort"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/npfastsortcpp/","language":"Python","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/hansalemaos.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}},"created_at":"2023-02-01T22:16:55.000Z","updated_at":"2023-02-01T22:27:30.000Z","dependencies_parsed_at":"2023-02-17T11:45:42.261Z","dependency_job_id":null,"html_url":"https://github.com/hansalemaos/npfastsortcpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hansalemaos/npfastsortcpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fnpfastsortcpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fnpfastsortcpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fnpfastsortcpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fnpfastsortcpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansalemaos","download_url":"https://codeload.github.com/hansalemaos/npfastsortcpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fnpfastsortcpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268618894,"owners_count":24279270,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":["cpp","fast","numpy","python","sort"],"created_at":"2025-08-03T22:01:45.405Z","updated_at":"2025-10-24T23:02:09.080Z","avatar_url":"https://github.com/hansalemaos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sorts int/float 4x faster than numpy by using parallel_sort from C++\n\n\n## the bigger the array, the bigger the difference\n\n\n### pip install npfastsortcpp \n\nIt is basically a self-compiling Windows version of [https://stackoverflow.com/a/28663374/15096247](https://stackoverflow.com/a/28663374/15096247)\n\n\n## Make sure you use the right MSVC C++ x64/x86 build tools (Link at the end of the description)\n\n\n```python\n# import the module:\nfrom npfastsortcpp import parallelsort\n\n\n\n# optional (if you want to check if the fast\n# version is used) \n# If the fast version can not be imported, \n# you will see a warning when you call parallelsort\nfrom npfastsortcpp import npfastsortconfig\nnpfastsortconfig.enablewarning=True\n```\n\n\n\n```\nThe first time you import the module, you will see this:\n______________________________\nCompiling ... \nIf you get an error, download:\n https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community\u0026channel=Release\u0026version=VS2022\u0026source=VSLandingPage\u0026passive=false\u0026cid=2030\nand install: MSVC ..... C++ x64/x86 build tools\n______________________________\nCompiling C:/Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.pyx because it changed.\n[1/1] Cythonizing C:/Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.pyx\nrunning build_ext\nbuilding 'npparallelsortcpp' extension\n\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe\" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\\Users\\Gamer\\anaconda3\\envs\\stopjogo\\include -IC:\\Users\\Gamer\\anaconda3\\envs\\stopjogo\\Include \"-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\include\" \"-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include\" \"-IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt\" \"-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um\" \"-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared\" \"-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt\" \"-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt\" \"-IC:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um\" /EHsc /TpC:/Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.cpp /Fobuild\\temp.win-amd64-cpython-39\\Release\\Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.obj\nnpparallelsortcpp.cpp\nC:/Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.cpp(2746): warning C4244: '=': conversion from 'long' to 'char', possible loss of data\n\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe\" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\\Users\\Gamer\\anaconda3\\envs\\stopjogo\\libs /LIBPATH:C:\\Users\\Gamer\\anaconda3\\envs\\stopjogo /LIBPATH:C:\\Users\\Gamer\\anaconda3\\envs\\stopjogo\\PCbuild\\amd64 \"/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\lib\\x64\" \"/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64\" \"/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64\" \"/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x64\" /EXPORT:PyInit_npparallelsortcpp build\\temp.win-amd64-cpython-39\\Release\\Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp/npparallelsortcpp.obj /OUT:C:\\Users\\Gamer\\anaconda3\\envs\\stopjogo\\lib\\site-packages\\npfastsortcpp\\npparallelsortcpp.cp39-win_amd64.pyd /IMPLIB:build\\temp.win-amd64-cpython-39\\Release\\Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp\\npparallelsortcpp.cp39-win_amd64.lib\n   Creating library build\\temp.win-amd64-cpython-39\\Release\\Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp\\npparallelsortcpp.cp39-win_amd64.lib and object build\\temp.win-amd64-cpython-39\\Release\\Users/Gamer/anaconda3/envs/stopjogo/lib/site-packages/npfastsortcpp\\npparallelsortcpp.cp39-win_amd64.exp\nGenerating code\nFinished generating code\n```\n\n\n\n### **If you get an error, download:**\n\n[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community\u0026channel=Release\u0026version=VS2022\u0026source=VSLandingPage\u0026passive=false\u0026cid=2030](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community\u0026channel=Release\u0026version=VS2022\u0026source=VSLandingPage\u0026passive=false\u0026cid=2030)\n\n\n### **and install:**\n\nMSVC ..... C++ x64/x86 build tools\n\n\n### Let's compare numpy and npfastsortcpp\n\n\n```python\n\nfrom npfastsortcpp import parallelsort\nfrom time import perf_counter\nimport numpy as np\narr=np.random.randint(1, 15000000 + 1,size=15000000)\n#arr=np.random.randn(5000000)\narr2 = arr.copy()\nstart=perf_counter()\nparallelsort(arr) # Sorting is in place! The function returns None!\nprint(f'npfastsortcpp: {perf_counter() - start}')\nstart=perf_counter()\nnp.sort(arr2)\nprint(f'numpy: {perf_counter() - start}')\nnpfastsortcpp: 0.27110049999998864\nnumpy: 0.9681288999999964\n\n\n\narr=np.random.randn(5000000)\narr2 = arr.copy()\nstart=perf_counter()\nparallelsort(arr) # Sorting is in place! The function returns None!\nprint(f'npfastsortcpp: {perf_counter() - start}')\nstart=perf_counter()\nnp.sort(arr2)\nprint(f'numpy: {perf_counter() - start}')\nnpfastsortcpp: 0.11203969999999686\nnumpy: 0.35269389999999134\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fnpfastsortcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansalemaos%2Fnpfastsortcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fnpfastsortcpp/lists"}