Generalize erts_qsort optimizations and insertion sort for small arrays
Generalize erts_qsort optimizations and insertion sort for small arrays

* Revert the optimization that removed random pivot indices as this
  can lead to bad performance for certain inputs

* Introduce a fast-path-slow-path optimization that use a fast-path
  that assumes that there is no other item equal to the pivot item in
  the array. If the fast-path fails, the algorithm falls back to a
  slow path that keeps track of three regions (one for items smaller
  than the pivot, one for items equal to the pivot, and one for items
  greater than the pivot).

* Use insertion sort to sort small arrays as this algorithm is faster
  than quick sort when the array is small enough

* Give the random pivot selection a better seed to get better random
  pivot indices.

ferd/otp,erlang/otp,ferd/otp,erlang/otp,dumbbell/otp,isvilen/otp,bjorng/otp,uabboli/otp,getong/otp,erlang/otp,potatosalad/otp,bjorng/otp,emacsmirror/erlang,potatosalad/otp,uabboli/otp,dgud/otp,bjorng/otp,erlang/otp,jj1bdx/otp,g-andrade/otp,dumbbell/otp,dgud/otp,ferd/otp,g-andrade/otp,mikpe/otp,bjorng/otp,jj1bdx/otp,emacsmirror/erlang,vinoski/otp,mikpe/otp,getong/otp,potatosalad/otp,erlang/otp,dumbbell/otp,mikpe/otp,uabboli/otp,mikpe/otp,uabboli/otp,rlipscombe/otp,isvilen/otp,uabboli/otp,mikpe/otp,getong/otp,dgud/otp,getong/otp,isvilen/otp,dgud/otp,potatosalad/otp,jj1bdx/otp,rlipscombe/otp,potatosalad/otp,uabboli/otp,mikpe/otp,vinoski/otp,isvilen/otp,g-andrade/otp,vinoski/otp,g-andrade/otp,g-andrade/otp,bjorng/otp,emacsmirror/erlang,ferd/otp,dgud/otp,g-andrade/otp,erlang/otp,emacsmirror/erlang,rlipscombe/otp,jj1bdx/otp,jj1bdx/otp,dumbbell/otp,isvilen/otp,dumbbell/otp,ferd/otp,jj1bdx/otp,rlipscombe/otp,isvilen/otp,dgud/otp,bjorng/otp,emacsmirror/erlang,emacsmirror/erlang,mikpe/otp,dumbbell/otp,getong/otp,mikpe/otp,potatosalad/otp,dumbbell/otp,emacsmirror/erlang,vinoski/otp,isvilen/otp,jj1bdx/otp,uabboli/otp,rlipscombe/otp,g-andrade/otp,vinoski/otp,bjorng/otp,getong/otp,potatosalad/otp,vinoski/otp,bjorng/otp,erlang/otp,getong/otp,erlang/otp,potatosalad/otp,ferd/otp,jj1bdx/otp,dgud/otp,ferd/otp,uabboli/otp,getong/otp,dgud/otp,bjorng/otp,g-andrade/otp,dumbbell/otp,g-andrade/otp,rlipscombe/otp,isvilen/otp,rlipscombe/otp,uabboli/otp,vinoski/otp,erlang/otp,jj1bdx/otp,rlipscombe/otp,bjorng/otp,dgud/otp,rlipscombe/otp,dumbbell/otp,emacsmirror/erlang,vinoski/otp,getong/otp,mikpe/otp,mikpe/otp,isvilen/otp,potatosalad/otp,isvilen/otp,ferd/otp,g-andrade/otp,potatosalad/otp,vinoski/otp,emacsmirror/erlang,dumbbell/otp,rlipscombe/otp,emacsmirror/erlang,ferd/otp,getong/otp,jj1bdx/otp,vinoski/otp,erlang/otp,dgud/otp