Will the Zend framework make my AJAX app faster?
In my application right now, each action performed by the user is separated into individual files. For instance, there could be save_file.php
, login_action.php
, parse_javascript.php
, etc. To perform an action, all you'd have to do is request the individual php file. Each method has no unnecessary code that doesn't get run.
开发者_C百科Now, a friend of mine says that using an actual framework (the Zend framework in this case), will be able to handle more users simultaneously and will run faster. I'm not much of a fan of frameworks, and I've never had the need for one. If it ain't broken, it ain't need fixin', imo. From my perspective, the raw PHP will be just as efficient as whatever code the framework can give.
So unless Zend does some voodoo magic, it seems it would just complicate the whole project instead of help it. Now I'm not talking MVC advantages here. My ajax stuff uses an MVC-like structure, so all we're comparing is speed and efficiency.
Make no mistake: using a PHP Framework will not automatically speed up your code. Frameworks just help you organize your code. It is possible, through proper use of the framework (i.e. structuring your application intelligently, etc.), that your code may run faster than unorganized, sloppy code without a framework.
But, this is just a side-effect of a well structured application. It is completely possible to use a framework and have your application run slower than if you hadn't used a framework.
Also, as far as frameworks go, Zend Framework is actually one of the slower ones. CakePHP, Symfony, and probably others are faster. This isn't just my opinion: I've been reading their design goals for Zend Framework 2.0, and speed is an important factor they say they need to work on.
All that being said, I would recommend Zend Framework. I've just completed my first application with it (several more on the way), and I've found it a great tool for keeping my code organized. But really any framework will help you with this, so explore the options.
精彩评论