Looking at slow requests in newrelic for a product listing page the top function called was Mage_Catalog_Model_Product_Image::_checkMemory() which does a bunch of stuff like checking the ini settings for memory_limit (
ini_get('memory_limit'), checks the image size and calculates the memory needed for that and so on...
I've just added a
return true (skip the checks, Magento has enough memory for those processes) in that function and the graph below shows the impact.
Anyone else did anything about this? Ideas, risks?