Faulty MAF can cause your symptoms. Cleaning helps, but sometimes it is beyond that. Below is an example where it was beyond cleaning, and needed replacement.
In that case, random misfire was occurring, and performance above 4000rpm was greatly reduced.
You can test the difference in driving/performance by unhooking the MAF, and going for test drive. You'll get another CEL code, but at least you can see if the MAF is sending bad signals creating performance changes before and after.
**of course, may be another issue, just thought I'd share this aspect!