catalin560's avatar

is laravel really bad for performance?

according to this https://medium.com/@mihaigeorge.c/web-rest-api-benchmark-on-a-real-life-application-ebb743a5d7a3 laravel is the slowest among other popular frameworks out there...

0 likes
11 replies
jlrdw's avatar

Come on, this is a classic case of over thinking an article. If so concerned use something else. Laravel is fine for a larger (medium) to smaller site with a fair amount of traffic.

Is it ready to handle Fedex size , well no.

This stuff is common sense as to what to use for what application.

Any framework will be slower than straight pdo, due to a lot of things happening in the background (vendor) folder.

A good read: https://www.reddit.com/r/PHP/comments/1x5g3a/4_reasons_why_all_php_frameworks_suck_rasmus/

adelf's avatar
adelf
Best Answer
Level 2

Actually, Laravel is fine.

We had a laravel project with 5+ millions unique visitors per day. It worked well on AWS. Yes, it should be tuned well, but it works pretty good.

All these simple tests are useless. I think he didn't cached configs, routes, etc. Also, real app is much more complicated and the difference is lesser than in simple tests.

The perfomance of highload project depends on high level architecture(data storages, queues, caches) much more than on chosen framework.

1 like
jlrdw's avatar

so for example ERP applications shouldn't be done in laravel?

For CH Robinson no.

For a medium to smaller enterprise, yes.

CH Robinson probably deals with more database records in a month than all forum members here combined deals with in a life time. Again, common sense.

adelf's avatar

CH Robinson probably deals with more database records in a month than all forum members here combined deals with in a life time. Again, common sense.

I think there are lot of services(microservices) and some of them, which doesn't work with huge real-time data, can be written in laravel. Why not?

jlrdw's avatar

I agree, many enterprise leverage several technologies. As an example, the State of Texas (heavy) employee site, meaning what you use at work is completely different that what the public sees.

For the public, it's "prettied" up.

I have seen some large enterprise use java technology in some areas, asp.net, php, nodejs. Most large companies are leveraging many technologies.

But again, it gets back to using a technology where it works best for that company.

cmdobueno's avatar

I find these 'tests' and 'comparisons' boring, out dated, and generally just wrong.

Now, all of what I said, is also wrong, but it is also true. (Let that sink in for a few seconds... confusing isn't it?)

Every single language and framework within that language has its place. If you are building an ERP to handle medium+ data, pick something that fits.

If you are building a small scale blog, go with something that fits. You are not going to spend thousands and thousands of dollars to build out a small scale blog site that expects to have 0-100 unique users per month, you would probably use a simple word-press (EVIL) and some pre-built theme, end up spending 1-2 hours (time = money remember this).

IF you blog is going to have 1000-10000 unique, you may decided to go with (total examples okay... just examples...) a custom built laravel blog. Lets say this takes you 10-20 hours to configure and setup.

Now if you are building a 'facebook' level app with bagillions (VERY TECHNICAL TERM) of active people at all times, you probably shouldn't use something based around php. Maybe something that uses go, node, or i dont really know... fill in the blank with whatever YOU think is best here... and now you will be spending i don't know 500-1000 hours building things money printing app.

Everything is dependent on your future plans for what you are building. I can build out a blog in word-press in an hour or two, I can do the same in laravel in a bit login (I don't know how long... but more than 2 hours), you have to consider the core language even before the framework.

1 like
catalin560's avatar

interesting... so what you're saying, @cmdobueno , that laravel is limited by its core language, php?

@adelf that sounds awesome! may I ask what was this project and how were you involved in it?

cmdobueno's avatar

Of course, every single framework is limited by its core.

PHP, is a great programming language. It does wonderful things, and is fantastic in doing what it does.

Let me be totally transparent, I would personally pick php over all other langues (and I have) for 99.99% of the work I have done.

99.99% of the work I have done is dealing with user bases under 500k.

As @adelf has shown, you can properly configure a laravel/php project to handle more, leverage tools and utilities out there, so it is totally possible.

For me, if a project would have over a large scale user base, (or be handling large amounts of data) I would have to consider going down a different path. Off the top of my head (and because I have never had a reason to look for it), I do not know what would be best. My first guess would be something build in node.js and using a more efficient database engine than mysql. But again, I have not faced the need to research any of this.

Hope this help

1 like
rawilk's avatar

You also need to keep in mind the quality of your own code. You could be using the most efficient language/framework out there, but if your code is not very efficient or written very well, it's going to negatively affect the performance of the application.

shez1983's avatar

for me, in my previous job - i built an api with laravel and i was having issues whenever we load tested.. the server couldnt take more than x amount of request (cant remember exactly what the x amount is but it was quite low) so we also had to buy multiple servers/load balancing etc

Please or to participate in this conversation.