We’ve run the same profiler and we have seen similar results. What it’s measuring is the % processor usage, but it’s not fully reflective of your load time.
Taking your numbers as an example, you’ll have found that the plugin’s ~33% time would not actually change before or after your images were optimized. So your site was loading at 5.5s, and then it’s down to 3.4s. But, the % processing used by the plugin would be unchanged. What you optimized was the delivering of the data to the client, and my guess is there’s more to be done.
The P3 profiler plugin is alright, but it doesn’t actually represent your page load time. It represents the amount of processing time a plugin takes during the load. What it can’t show you is how fast your site is loading resources, delivering them to your client (browser) and how fast/slow your database queries are running. As you’ve seen, you can optimize your site (with your images) and it has no changes on % time the firewall runs.
Does that make sense?
This is the assumption that is being made here:
My site is loading slow. So I’ll run performance profiling on it. I found P3. It says the Firewall uses 33% processing time. Therefore, the Firewall plugin is responsible for the slow loading times.
But actually, unfortunately, these are not valid links and this is a common mistake with the P3 profile plugin. It’s really very difficult to ascertain bottlenecks in site loading performance. You identified 1 and optimized it. But just because the Firewall takes up much of the performance in terms of CPU time, doesn’t make it the culprit.
If the Firewall is say, 0.7s and that’s 33%. That means 100% is 2 seconds. Before optimization you have ~1.5s extra of client resources loading and db read/write. That 1.5 is actually about 40% of the total (3.5s).
Take an extreme example. You could have a plugin which does nothing else except crunch data and read/write to the DB, and then queue in JS and CSS files in the client front-end. The CPU time would be miniscule, but the site load time would be HUGE. CPU usage time isn’t correlated to the load time.