BLD: various test_perf fixes
Merge pull request #6235 from y-p/PR_tp

BLD: various test_perf fixes