Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony on Xampp is very slow in development, what can I do?

I have set up Symfony but every page load requires 40 seconds.

If I have an empty controller it takes 8 seconds to load. If I start to make some complex queries on the database, it's worse. What can I do?

  • deactivate the profiler? (will this change a lot?)
  • activate APC on dev mode? (but will this not be a problem for changing the code)
  • put the session inside APC?
  • put Doctrine in the garbage?
  • .... ?

I don't really know where to start.

(I am using Windows 7 with Xampp server and 8gb of ram)

like image 657
Alexandre Avatar asked Nov 20 '13 14:11

Alexandre


People also ask

Is Symfony slow?

Symfony is not slow in the meaning of "not optimized" How do we know it? Because we measured. We do use profiling tools a lot, on our own applications as well as on symfony itself. In fact, if you look at the symfony code, you can see that there are numerous optimizations already in place.


1 Answers

A few quick suggestions:

  • install PHP 5.5.x (faster)
  • Use mod_fcgid instead of mod_php with Apache
  • Raise realpath_cache_size and realpath_cache_ttl in your php.ini
  • disable XDebug
  • ...

See this question, this question and this question.

like image 87
Nicolai Fröhlich Avatar answered Oct 18 '22 11:10

Nicolai Fröhlich