A client of mine is using a commercially available theme on his site (Mango by Smartwave) and it is incredibly slow. I enabled the profiler and Mage is taking between 3.8 and 4.8 seconds to load. Here's the first few lines of the profiler output.
Code Profiler Time Cnt Emalloc RealMem mage 4.8259 1 0 0 mage::app::init::system_config 0.0080 1 80,568 0 CORE::create_object_of::Mage_Core_Model_Cache 0.0074 1 379,864 786,432 mage::app::init::config::load_cache 0.0101 1 1,784 0 mage::app::init::stores 0.0433 1 3,123,752 2,883,584 CORE::create_object_of::Mage_Core_Model_Resource_Website 0.0010 1 57,232 262,144 CORE::create_object_of::Mage_Core_Model_Resource_Website_Collection 0.0207 1 1,647,856 1,572,864 DISPATCH EVENT:resource_get_tablename 0.0265 2100 105,128 0 DISPATCH EVENT:core_collection_abstract_load_before 0.0008 54 3,064 0
I switched to the default/default theme and Mage loaded in milliseconds. My question is, what could be slowing Mage down so much and is it possible to speed it up. The site is hosted on a very fast shared server with Google Mod Pagespeed enabled and Memcached enabled. I uploaded a copy of the site to my development server (also with Mod Pagespeed but without Memcached) and Mage takes about 4 seconds to load Mage.
I ran a pingdom test on the demo of the theme and that also takes about 4 seconds for Mage to load (you can see it on the pingdom tests as the initial wait time for the server to respond, this is the server waiting for Mage to load with this theme).
I think this all proves that it isn't a server related delay, that it's just a badly coded theme. What can I do to speed it up?