backport benchmark framework from master