support struct sort
Opened this issue · 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?
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.
Thank you for your suggestion. I have started to use https://github.com/golang/exp/tree/master/slices
to implement it.