title: symfony2 + doctrine2 - how lazy loading affect our applications?
body: <p>This will be a sort of Q/A for everyone that wonder about symfony2 + doctrine2 and performance.</p>
  
  <p>I'm writing this Q/A because I've started to playing around SF2+doctrine for a new project and I wanted to do some performance tests. I've surfed the net but didn't find a complete answer for my doubts so I've decided to make my own one. Hope this will be useful for someone</p>
  
  <p>Let's say we have two entities like the following</p>
  
  <pre><code>//all ORM declaration here
  class Lodging
  {
    //some declaration here
  
    /**
     * @ORM\ManyToOne(targetEntity="Currency")
     * @ORM\JoinColumn(name="currency_iso_code", referencedColumnName="iso_code")
     */
    protected $currency;
  
    //some methods here
  }
  
  //all ORM declaration here 
  class Currency
  {
    /**
     * @ORM\Id
     * @ORM\Column(type="string", length=3)
     */
    protected $iso_code;
  
    /**
     * @ORM\Column(type="string")
     */
    protected $description;
  
    //some methods here
  }
  </code></pre>
  
  <p>Now you will made an entity type for <code>Lodging</code> where you will be able to create or - if the entity passed to the type has some prefetched values - to edit a Lodging object (let's concentrate on that case). In that form you also need the description of <code>Currency</code>, not only the <code>$iso_code</code>.</p>
  
  <p>Question: is better to use <code>-&gt;findOneById()</code> doctrine2 method or to write a DQL (or use query builder facility)?<br/>
  Why?</p>