pdqsort icon indicating copy to clipboard operation
pdqsort copied to clipboard

support struct sort

Open hawkingrei opened this issue 2 years ago • 2 comments

Hello, TiDB has a plan to use pdqsort to improve sort performance. but we find that Golang will support pdqsort in the Go1.19. So we decide to use this library to achieve our goals. however, we find this library only sorts this base type and we need to sort the slice of custom type. Have you a plan to improve it?

hawkingrei avatar Apr 26 '22 11:04 hawkingrei

Happy to see TiDB plan to use the new implementation! The generic version of pdqsort is located in https://github.com/golang/exp/tree/master/slices for now, and it will be moved to the std in the future. The problem is that the APIs in the slices may be changed at any time. A possible solution is to copy the related code into the TiDB project, once the slices is merged into std, we can easily change the code. For this repo, I'm still not sure whether it needs to be maintained, since it has already been merged into the Go runtime.

zhangyunhao116 avatar Apr 27 '22 11:04 zhangyunhao116

Thank you for your suggestion. I have started to use https://github.com/golang/exp/tree/master/slices to implement it.

hawkingrei avatar May 06 '22 15:05 hawkingrei