title: Symfony 2 performance optimisations
body: <p>We're looking for a PHP framework to work with in future and are currently testing out things with Symfony 2. For this, we've redesigned our API and implemented it as a bundle in Symfony. It turned out that Symfony seems to be <strong>very</strong> slow - actually <strong>far</strong> slower than our old (not even well-designed) system.</p>
  
  <p>We tried to optimise the performance by caching the byte code (using APC for this). While we've noticed a huge improvement in performance (before: about 3 seconds to load the API; after: 0.6 seconds in average (still 0.5 seconds slower than our old system <strong>without</strong> APC)), we're kind of excited - but still not really pleased with the high loading time of such an easy task like getting one result out of an almost empty database.</p>
  
  <p>I don't know, but I could imagine this is due to Symfony autoloading all classes, even when not needed for a specific bundle.</p>
  
  <p>Now, before we deep-six Symfony, we'd like to look out for further optimisations, possibly a way to exclude unneeded components in a specific bundle, as I personally think this would make a big difference.</p>
  
  <p>I'd be thankful for any ideas on how to further improve the performance, experience reports with using Symfony or anything else that could be helpful for us on the lookout for a framework.</p>
  
  <p><strong><em>Edit:</em></strong></p>
  
  <p>Some information about the testing environment:</p>
  
  <ul>
  <li>Operating system: <strong>Ubuntu 12.04.4 LTS (GNU/Linux 3.8.0-38-generic x86_64)</strong></li>
  <li>Apache version: <strong>Apache/2.2.22 (Ubuntu)</strong></li>
  <li>PHP version: <strong>5.3.10-1ubuntu3.13</strong></li>
  <li>Considerable PHP extensions: <strong>apc</strong></li>
  </ul>
  
  <p>Also, all tests are done on a local copy of our system, so possible network issues can be excluded.</p>