Skip to content
High Performance Computing Algorithms in Javascript. Faster and better algorithms.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

If you like hpc-algorithms, then help us keep more good stuff like this coming.
Let us know what other algorithms could use acceleration or improvement.


High Performance Computing Algorithms in JavaScript

Faster and Better Algorithms, starting with high performance sorting:

  • LSD Radix Sort for unsigned 32-bit integer arrays. 20-30X faster than JavaScript's built-in array sort for arrays less than 35 Million. 5-10X faster for arrays greater than 35 Million. This sort algorithm is not in-place, returning a new sorted array. Discussion, benchmarks and usage in
  • LSD Radix Sort for arrays of objects by an unsigned integer key. 15X faster than JavaScript's built-in .sort(). This is a stable sort, while JavaScript built-in is not stable. This sort algorithm is not in-place, returning a new sorted array. Discussion, benchmarks and usage in
  • Counting Sort for Uint8 and Uint16 typed arrays. 40X faster for Uint8 arrays and 15X faster for Uint16 arrays. This sort algorithm is in-place.

When you benchmark these algorithms keep in mind that for the first few runs the basic JavaScript JIT compiler is used, providing fast start up time and giving time for the optimizing compiler to run. After these few runs the optimized code starts being used, revealing the full performance of LSD Radix Sort and Counting Sort algorithms. See for more details about the JIT engine in Chrome.


function simpleUsageExampleOfRadixSortLSD() {
    var arrayToBeSorted = [ 99, 1999999999, 51, 23, 102];
    var sortedArray = HpcAlgorithms.Sorting.RadixSortLsdUInt32(arrayToBeSorted);
    for ( var _current = 0; _current < sortedArray.length; _current++ ) {

If you have other specific needs for higher performance algorithms, let us know.

You can’t perform that action at this time.