Wouldn't hurt to check the condition of the air filter as well since the OP is looking under the hood.Diagnostic codes will have been generated. Have someone with a scanner look at the codes and explain them to you. A bad spark plug, fuel injector, or sensor could create this kind of performance problem.
FWIW: I would get that same code when I ran the K&N oiled performance air filter. Cleaned the MAF and the code, would return. Replaced the K&N filter with the stock paper pleated version and never saw a problem again. This car is "funny" about it's air filters.The ce light came on right after this post. The code that came up is p0171 system too lean bank 1. I cleaned the maf and now the light us out and car runs better. CE light went out on its own.