By my tests, this version of cv::arcLength is almost 10% faster than the one using a buffer it replaces.