Adaptive performance optimization under power constraint in multi-thread applications with diverse scalability