Write your sort (or start from a template) and see how much work it really does: comparisons, reads and writes, on arrays of 8 to 1024 elements.
Write a function sort(a) that sorts the array a in place, or start from a template. It runs in your browser, apart from the page and with an 8-second limit, on arrays of 8 to 1024 elements that are already sorted, reversed and random. Your code does not need any changes to be counted: every time you compare two elements with <, > or by subtracting them, that is one comparison; every a[i] is a read and every a[i] = … a write.
With the large sizes, the tool tests which curve best fits your counts: n, n log n or n², and with what constant (“≈ 0.5·n²”). It is a measurement, not a proof: an algorithm can look n log n at these sizes and not be.
A sort is stable if two elements with the same key stay in the order they came in. The tool checks it with an array full of repeated keys that remember their original position.
Comparisons with === (they do not call valueOf) and whatever you do in auxiliary arrays, except when you write back into a. Comparing an element with a plain number counts as half a comparison.
Write your sort (or start from a template) and see how much work it really does: comparisons, reads and writes, on arrays of 8 to 1024 elements.