title: How can I improve the performance of the Symfony Serializer?
body: <p>I try to get a json variable from my database:</p>
  
  <pre><code>$table = $this-&gt;em-&gt;getRepository('App\\Entity\\Data')-&gt;findAll();
  $encoders = [new JsonEncoder()]; 
  $normalizers = [new DateTimeNormalizer(array('datetime_format' =&gt; 'd.m.Y')), new ObjectNormalizer($classMetadataFactory)];
  $serializer = new Serializer($normalizers, $encoders);
  
  $groupsArray = $serializerGroups-&gt;getSerializerGroups($slug);
      $groups = $groupsArray['groups'];
      if( $groups != null) {
        $context['groups'] = $groups;
      }
  
  
  $output = $serializer-&gt;serialize($table, 'json', $context);
  
  dump($output);
  </code></pre>
  
  <p>The page loads really long until I see the result of output.
  How can I make it faster?</p>