Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Symfony and CakePHP too slow to be usable?

Until now, I have always said that CakePHP is too bloated and slow. I don't really know that, I just saw "some" benchmarks. What I really want to know, is that if those two frameworks (Symfony and CakePHP) are too slow to be usable in a way that the user will get frustrated. I already know that those frameworks are slower than other alternatives, but that's not the question.

I ask the question because I want to create a project management web application and I still hesitate between a couple frameworks. I've had some trouble learning Zend, but imho I haven't tried hard enough.

So in conclusion, in addition to the first question above, I would like to ask another question:

If I want to create a project management tool (which is a pretty big project), which of the following should you suggest, considering the developement time, the speed of the resulting application, and the robustness of the final product:

  • Symfony
  • CakePHP
  • Zend Framework

Also I should mention that I don't know any of those frameworks, and that I want to learn one of them (at least).

like image 279
Robert Audi Avatar asked May 28 '10 12:05

Robert Audi


4 Answers

The problem with benchmarks, is that they normally don't lend themselves to the real world. Write a real application, and you'll see that all the frameworks are within about an order of magnitude of each other when it comes to speed. And they are all slower than if you didn't use a framework (and know how to program).

However, what you need to look at is the tradeoff. Frameworks sacrifice a little performance for the ability to reduce development time significantly. What's more important to you, raw unadulterated performance or reasonably rapid development time? Facebook wouldn't use a RAD framework for their site, but that's because the performance to them is worth more than the added development time. Likewise a small company with a single developer is likely to benefit more from a framework than the reasonably small performance hit (I say small, because the impact on each page view is minimal. The effect "adds up" with higher traffic).

What I'd suggest, is take a look through a bunch of frameworks. Try them (most have a "blog" tutorial). Get a feel for how they work. Pick one that you like, and then play around with it for a little while. Learn its coding style, and how it likes to do things... Most importantly, learn how it functions. Try to learn the "why" behind the details. The ability to use a framework is IMHO directly tied to the understanding of how it operates... Don't use something you're uncomfortable using unless you have to. Find one that "fits" you, and then stick with it until you are fluent...

like image 52
ircmaxell Avatar answered Oct 03 '22 05:10

ircmaxell


I recommend cakePHP v1.3 because it is faster and easily understandable. You will find very good help (documentation and tutorials) related to this framework. The documentation is well written. Even if you are stuck in somewhere you will be able to find a solution on stackoverflow or cakephp google group or by searching on google.

I have worked on both versions of cakephp (1.2 and 1.3) and I have also tried up a hand on Zend framework (I too tried my level best but got stuck in the framework when it came to the implementation of layouts).

But after spending more than a year on cakephp I am proud to say that it is the best framework to work with.

like image 34
Gaurav Sharma Avatar answered Oct 03 '22 05:10

Gaurav Sharma


Frameworks generally aims to better code organization, reusability of components, testability, and to generalize, application quality & maintenability. This can not be the more performance oriented choice.

I got sites running with symfony that are pretty fast, the benchmarks comes close to the original static HTML template.

Performance issue could happen more quickly when using a framework (and an ORM like Doctrine) than when putting spagetti code inside an HTML static page. That's sound normal to me : more treatements, more verifications, mode dependencies, more code to parse, etc.

If you mant to make application faster, they're is basically to ways :

  1. Get faster hardware, it costs, but can be worth it if this cost is under programmers & engineers cost, which is generally the case.
  2. Optimize software, the bigger step to this way is to use caching on multiple level : opcode, database query results, any heavy objects, html rendering (partial and whole).

With a well designed MVC application you can manage performance as an isolated issue, using profiler to views application's bottlenecks and treat them one by one (once again, optimization can be on hardware side too).

The choice of a PHP framework should not be made on various performance tests seens on blogs arcticles, they can not be objective. From my point of view, all major MVC frameworks can be used to build performant websites, it's all matter of optimization.

If you and your team better known Symfony, CakePHP or Zend, then go for it. You'll handle performance optimization once your application is functionnal, there are solutions for any frameworks.

If team experience is too wide and anyone has its own preference, then I would personnaly suggest Symfony, as its caching capabilities comes built-in with the framework (I don't know for others)

like image 41
Benoit Avatar answered Oct 03 '22 03:10

Benoit


The differences are going to be negligible because your slow pieces are always going to be I/O - Database, Filesystem, etc. Ensure you have a good data caching strategy and don't do anything too outrageously dumb in the code and it won't matter.

like image 38
Justin Avatar answered Oct 03 '22 03:10

Justin