Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansalemaos/cppradixsort
parallel_radixsort from C++ for Python (Windows)
https://github.com/hansalemaos/cppradixsort
cpp numpy parallel-computing python sort
Last synced: 5 days ago
JSON representation
parallel_radixsort from C++ for Python (Windows)
- Host: GitHub
- URL: https://github.com/hansalemaos/cppradixsort
- Owner: hansalemaos
- License: mit
- Created: 2023-02-25T10:34:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-02-28T20:19:48.000Z (over 1 year ago)
- Last Synced: 2024-04-26T01:43:32.922Z (7 months ago)
- Topics: cpp, numpy, parallel-computing, python, sort
- Language: Python
- Homepage: https://pypi.org/project/cppradixsort/
- Size: 204 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# parallel_radixsort from C++ for Python (Windows)
## pip install cppradixsort
#### Microsoft Visual C++ Redistributable is necessary
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170```python
from cppradixsort import parallel_radixsortimport numpy as np
a1 = np.random.randint(0, 2000000, 1000000)
a2 = parallel_radixsort(a1)# a1
# Out[3]: array([ 173641, 1852805, 1959843, ..., 1094448, 430953, 1021449])
# a2
# Out[4]: array([ 0, 0, 13, ..., 1999996, 1999996, 1999997])
# %timeit parallel_radixsort(a1)
# 4.96 ms ± 32.6 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
# %timeit np.sort(a1,kind='stable')
# 63.8 ms ± 72.9 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)```