Skip to main content

vector-qsort

Vectorized quicksort for NumPy arrays using Google Highway SIMD.

pip install vector-qsort

Quick start

import numpy as np
import vector_qsort

data = np.array([3.14, -1.5, 42.0, 0.0, -100.5, 2.71], dtype=np.float32)

# In-place SIMD sort
vector_qsort.sort(data)
# array([-100.5, -1.5, 0.0, 2.71, 3.14, 42.0], dtype=float32)

# Descending
vector_qsort.sort(data, desc=True)

# Non-mutating copy
sorted_data = vector_qsort.sorted(data)

sort() sorts 1D contiguous arrays in place with zero copies. sorted() returns a sorted copy. Supports float32, float64, int32, uint32, int64, uint64, int16, and uint16.

Benchmarks

Measured on Apple Silicon (ARM NEON) vs NumPy's native in-place np.sort():

python bench/bench_sort.py
Dtype Size Distribution NumPy (median) vector-qsort Speedup
float32 100,000 Random 1.14 ms 0.73 ms 1.57x
float32 5,000,000 Random 81.97 ms 50.39 ms 1.63x
float64 100,000 Random 2.25 ms 1.33 ms 1.70x
float64 5,000,000 Plateau 39.40 ms 18.04 ms 2.18x

Note on scalar sorts

Modern scalar sorts like driftsort and ipnsort excel at generic types and presorted run-detection. vector-qsort is designed specifically for raw numeric throughput on contiguous buffers by saturating SIMD vector lanes.

License

MIT © Hemanth.HM

Release files for vector-qsort 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vector-qsort 0.1.0
File Size Uploaded
vector_qsort-0.1.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vector-qsort 0.1.0
File Interpreter ABI Platform
vector_qsort-0.1.0-cp314-cp314-macosx_26_0_arm64.whl CPython 3.14 CPython 3.14 macOS 26.0+ ARM64 Details

Total release size:1.5 MB

Release files / vector_qsort-0.1.0.tar.gz

Download URL vector_qsort-0.1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2132f25e34c62d54bd9a4d35cb7221173ed8bb3aa6ae68c58e1c7829885505d4
BLAKE2b-256 checksum
How to use checksums
806287e01e9778b35f8631da26520b589b8f28678de03d6fc6f03a49e9953e3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / vector_qsort-0.1.0-cp314-cp314-macosx_26_0_arm64.whl

Download URL vector_qsort-0.1.0-cp314-cp314-macosx_26_0_arm64.whl
Size 1.4 MB
Tags CPython 3.14 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
6089e03a39c8735b1eb05bbda9611db01bc3b95f922b7c0a6c05d8dd18c2e8f8
BLAKE2b-256 checksum
How to use checksums
8e7ad5da0d4026e8e38ec973d6703b58e7d76adb2d2eef8c409425e431793f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page