On power capping and performance optimization of multithreaded applications