memory: in perf test, allow to specify the max number of threads to use.