Faster Random Number Generator

In my previous blogs, pseudo random number generators (PRNGs) running on a multi-core processor (CPU) or graphics processor (GPU) were shown to have vastly superior performance to those in the standard C++ libraries. Using several CPU cores, utilizing parallel instructions within each core paid off for CPU-based generators. Using hundreds of GPU cores took performance […]

Read more "Faster Random Number Generator"

Stable Sorting In JavaScript

JavaScript 2017 specification states the following about its built-in sorting, “The elements of this array are sorted. The sort is not necessarily stable (that is, elements that compare equal do not necessarily remain in their original order).” What’s a JavaScript programmer to do if a stable sort is needed? Good examples of stable and unstable sorting […]

Read more "Stable Sorting In JavaScript"

Radix Sort Implementations

Radix Sort is a high performance linear time sorting algorithm, which does not use comparisons. Instead, Radix Sort looks at each digit of the key and processes based on those digits. Two variations of the algorithm exit: least significant digit (LSD), and most significant digit (MSD). Each of the two variations has its own attributes, […]

Read more "Radix Sort Implementations"

Faster Sorting in JavaScript

JavaScript is taking over the world as the language of the web. When it comes to sorting, JavaScript is about 9 times slower than C++ and C#, but is slightly faster than Python 3.6, as I’ve shown in the previous post Sorting Speed of Several Languages. In this post, let’s explore the possibility of sorting faster in […]

Read more "Faster Sorting in JavaScript"

C++ Sorting Algorithms

The above graph compares performance of  several different sorting algorithms implemented in C++. X-axis is the array size being sorted. Y-axis is the time in seconds it took to sort the array. The faster the algorithm, the less time it takes to sort. The above graph is for arrays filled with uniformly distributed random unsigned […]

Read more "C++ Sorting Algorithms"