As a follow up, I have a small PR that should implement a partial sort !! version (modify vector and index vector) that I’ve done limited testing on. Not much but a start on the partial versions and seems to work for my purpose at the moment. It basically does quick select and then calls the sortperm!! function