npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vector-qsort

v0.1.0

Published

Vectorized quicksort for TypedArrays using Google Highway SIMD.

Readme

vector-qsort

Vectorized quicksort for TypedArrays and NumPy arrays using Google Highway SIMD.

npm install vector-qsort
# or
pip install vector-qsort

Quick start (JavaScript)

import vsort from 'vector-qsort';

const f32 = new Float32Array([3.14, -1.5, 42.0, 0, -100.5, 2.71]);

// In-place SIMD sort
vsort(f32);
// Float32Array [-100.5, -1.5, 0, 2.71, 3.14, 42]

// Descending
vsort(f32, { desc: true });

// Non-mutating copy
const sorted = vsort.sorted(f32);

vsort() sorts a TypedArray in place using SIMD. vsort.sorted() returns a sorted copy. vsort.async() sorts off the main thread. That's the whole API.

Quick start (Python)

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)

# 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.

Off-thread sorting (Node.js)

import vsort from 'vector-qsort';

const big = new Float32Array(10_000_000);
// fill with data...

// Runs on libuv worker thread — zero main thread blocking
await vsort.async(big);

Sorts large buffers in background worker threads without interrupting the Node.js event loop.

Benchmarks

Science-backed benchmarks measured on Apple Silicon (ARM NEON) using high-resolution monotonic clocks over 50 iterations with pre-allocated samples.

Node.js (vs V8 TypedArray.prototype.sort())

cd node && npm run bench

| Type | Size | Distribution | V8 (median) | vector-qsort | Speedup | |---|---|---|---|---|---| | Float32Array | 100,000 | Random | 5.18 ms | 0.72 ms | 7.12x | | Float32Array | 1,000,000 | Random | 63.90 ms | 9.31 ms | 6.86x | | Float32Array | 5,000,000 | Random | 359.60 ms | 50.66 ms | 7.10x | | Float64Array | 100,000 | Random | 5.38 ms | 1.41 ms | 3.82x | | Float64Array | 1,000,000 | Random | 65.56 ms | 17.19 ms | 3.81x | | Float64Array | 5,000,000 | Random | 360.88 ms | 95.42 ms | 3.78x | | Int32Array | 1,000,000 | Random | 15.42 ms | 8.73 ms | 1.77x |

Python (vs NumPy in-place np.sort())

cd python && 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