the short answer is how you guys haven't.
A more conceptual answer, async is for solving pending resource issues, not for heavy computing in general
With that said, nothing prevents you from having sorting in another process and communicating with it asynchronously
I would be very careful about two things: do not start a new process for each type, probably a good idea if it takes a while to start. If you have a large array, be careful with the copy of the memory you are sorting, if you don't care, you can simply return the ordered indices in the array;)
Fabiano ps
source share