Thursday, November 22, 2012

Speeding up the rendering of entity dropdowns in forms in Symfony 2

Update: See http://12wiki.blogspot.nl/2012/12/bundle-for-faster-generation-of-entity.html for an improved implementation.

One of the great features of Symfony 2 is the simplicity of rendering a form, even when you're using external entities. The only problem is that rendering a dropdown with 3662 entities is quite slow. In my case this took almost 2 seconds!

Wednesday, November 21, 2012

How to time your own events in Symfony 2?

As some of you might have noticed by now, I am quite interested in the performance of my application. Since Symfony 2 has such a great profiler I was looking for a way to time my own code within the existing profiler and without writing to much code.

Monday, November 12, 2012

Did KnpPaginator just break?

I just updated my symfony using Composer (which also updated my Doctrine etc). All of a sudden I now get the error 'Invalid parameter number: number of bound variables does not match number of tokens'.

I was able to fix this by making a change to /vendor/knplabs/knp-components/src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/QuerySubscriber.php

Why does the Symfony 2 firewall take so long to load?

During the development of my current project, I noticed in the profiler that the Firewall took about 1 second to load, which was more than 50% of the total load time.