2

We are starting off on development for a web based portal in PHP which is starting of as a prototype but is expected to grow into a considerably large system.

Performance is a key issue as the system should be scalable enough to support a large no. of users (100k users for e.g)

In the process of deciding upon a framework, the options we have are: 1. Use Core PHP/Smarty templates 2. Use a framework such as Laravel.

What are the pros and cons of using PHP/Smarty templates v/s Laravel considering performance as the key factor ?

Is it still worthwhile considering Laravel despite the performance hit it will have as compared to Core PHP or a simple templating framework ?

5
  • It's always worth considering a framework... if you're looking at 100k concurrent users, then you need to develop your site with scalability in mind anyway. good frameworks will help by providing a lot of scaling options for you; and performance overhead isn't that significant. Though you should always keep in mind that it exists, it shouldn't be a primary concern when dealing with a good, solid, reliable framework Commented Apr 12, 2014 at 10:04
  • Thanks, Is there any benchmark as to how slower a framework is compared to core PHP ? Commented Apr 12, 2014 at 11:43
  • No there isn't, nor will there likely be because it's all totally dependent on how you design and write your code.... but remember that frameworks generally also give you a consistent style in your design, provide a lot of built-in tools that you don't need to develop yourself, are tested with a large userbase (so you don't need to test the framework itself, and often provide a test harness for your own code as well), normally well documented, often have a faster learning curve for new developers joining the project in the future than any homebrew system, etc Commented Apr 12, 2014 at 11:47
  • Basically, homebrew code will generally be faster because you customise it exactly to your needs at the time, but often at significant maintenance and development costs in the future as the userbase grows and you need to scale and find that your tightly optimised homebrew system doesn't scale nicely Commented Apr 12, 2014 at 11:49
  • If you are interested in benchmarks of various FW please take a look at: techempower.com/benchmarks Commented Feb 25, 2015 at 16:55

1 Answer 1

11

If the question is: Is an application built with a framework slower than native code ? Then the answer is: Yes, less or more, a framework uses abstraction layers to simplify the development process and it (Framework) may take some extra time than native PHP code.

Does that really matter ?

I think it is not a problem at all, not enough time (difference) that one can catch the difference and a good framework is also built that keeping on mind. If you use a good framework and also properly write optimized code then it's fine and you don't have to worry about it.

Depending on the size of your project you should decide what to use and for a big project I always prefer a framework. There are many benefits for using a framework, such as a framework at first helps you to do more with less code, gives you unified API/Tools to accomplish complex tasks easily with less effort. A good framework gives you build scale-able and maintainable application and most of those are well organised, tested and maintained by a community so you may get help from the community on many situations.

Also, when developing application with many team members, it is much better that everyone is working on the same known documented framework, which might not be the case with your own archive PHP code and a framework also unites the team members to a specific convention of writing code because everyone follows same rule provided by the framework. It's also easy to recruit additional team members anytime who knows that framework and new team members can easily fit into development process.

Since, you said about 100k users, well I think it's related with the database than coding, if you have an optimized database then it may give you query result faster and yes also depends on queries you write, they also must be optimized.

So, I think you should use a framework and obviously make the decision by discussing with the team members you have right now. Laravel is a good one but there is a different candidate only for performance/speed and that is Phalcon and it's different than others because it's a compiled framework (c library) and that's why it's faster than others and maybe the fastest one so far.

But still, you should think about Laravel or suchlike one because Laravel has so many ready packages and support community than Phancon and it's easy to find help for a well known, widely used framework. These are my opinions but consider to use a framework, it'll make your life easier.

Performance benchmark of popular PHP frameworks (Source):

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.