Improve ptr_rotate performance, tests, and benches
#61937
Merged
ptr_rotate performance, tests, and benches
#61937