Thanks for using Just Answer, from what you have described it sounds like a contaminated MAF(Mass Airflow) sensor, or it is defective.
MAF sensors can get contaminated from a variety of sources: dirt, oil, silicon, spider webs, potting compound from the sensor itself, etc. When a MAF sensor gets contaminated, it skews the transfer function such that the sensor over-estimates air flow at idle (causes the fuel system to go rich) and under-estimates air flow at high air flows (causes fuel system to go lean). This means Long Term Fuel Trims will learn lean (negative) corrections at idle and learn rich (positive) corrections at higher air flows.
If vehicle is driven at Wide Open Throttle (WOT) or high loads, the fuel system normally goes open loop rich to provide maximum power. If the MAF sensor is contaminated, the fuel system will actually be lean because of under-estimated air flow. During open loop fuel operation, the vehicle applies Long Term Fuel Trim corrections that have been learned during closed loop operation. These corrections are often lean corrections learned at lower air flows. This combination of under-estimated air flow and lean fuel trim corrections can result in spark knock/detonation and lack of power concerns at WOT and high loads.
Disconnect the MAF and then drive to see if performance improves, if it does the MAF is bad.
Recommend going to your local auto part store and purchasing the specially designed MAF cleaner, remove the entire MAF and clean as an assembly, then dry with compressed air, if not available then let air dry.