some fixes in perf tests
Merge pull request #2325 from alalek:perf_fix