Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

korgoth's avatar

Laravel 5.2 currently sitting about 25% faster than Laravel 5.1

Just read this tweet: https://twitter.com/taylorotwell/status/674327734252892161

I was curious and tested the same application ( its a basic crud app ) with 5.1 and 5.2 but on my WAMP dev machine 5.2 boot time is about 20% slower than 5.1 with artisan optimize --force, composer dump-autoload. Anyone else tried to compare?

0 likes
11 replies
petrit's avatar

PHP 7 is faster than previous versions. Also laravel which runs on php 7 runs faster than ones that runs on php 5.6. So when we made tests, it is relative, especially on laptops or PCs, maybe you had another software running in background that consumed your machine resources. I agree totally that php 7 is faster.

korgoth's avatar

Both test was on 5.6 as Taylor mentoned: "before PHP 7".

thomaskim's avatar

That's great and all, but PHP7 is irrelevant to this conversation. This is strictly about the performance between 5.2 and 5.1. I haven't run any tests so I can't really comment on it though.

IvanBernatovic's avatar

What do you think, for bigger projects (aimed for longer service life of at least 5 years) that are still in early development on Laravel 5.1), is it worth getting 25% more speed with 5.2 at the expense of long term support? I'm not interested in new features of 5.2 (at least not for existing project in development). I know it really depends on project s purpose and requirements but I'm interested to hear opinions.

jekinney's avatar

@IvanBernatovic

I still have clients running l3. Just like the code to an interface debate, specifically swapping databases comes down to common sense imo. Meaning does it work and meet the requirements? Secure? Then MOST companies and clients aren't going to spend the money to upgrade. I've recently finished up a contract position to upgrade their code so they could run php 5.4. Like 6 months ago.

Fact of life stuff is expensive and most companies don't care as long as it works and meets the requirements. Using 5.0 or 5.2 clients don't care. Lot of dev teams still develop with L4. Why? Easier for them and existing code snippets etc.

You really need to be concerned more so when using open source cms' like Wordpress. Those sites are more likely to get hacked because anyone can download the code and popular plugins and find ways to force their way in. Takes a couple of minutes to download and learn the database schema admin routes, defaults etc.

Most cases a framework with 80% plus custom code that's NOT open source will be more secure whether or not the framework has a small hole manly because (php wise) the user won't know what framework.

Simple things like trying not to base db id in public url, change cookie name etc will dissuade most prying eyes. Other risks imo are more important like ddos, injecting scripts, loggin throttling and api end points not limited and/or to much data (I see this a lot, an endpoint showing the entire row and relationships just to display a name column).

IvanBernatovic's avatar

@jekinney Thanks for reply. Fair point. I am aware that companies use older technologies because transition to newer stuff is expensive and risky of breaking functionality ( = losing money). I get your point that developers are the one who have most responsibility for security concerns you mentioned. But that didn't completely answered my question so I will rephrase it: In this specific scenario where I am comparing LTS version and non-LTS version with more features and better performance, what is wiser to value, or how much LTS support matters for Laravel-based projects?

bashy's avatar

The main speed increase is the middleware not firing on every single route you hit.

jekinney's avatar

@IvanBernatovic

That's my point is it really doesn't matter, but it depends on who. For me I use the latest version. Lol, just like a new OS version or driver the newest is suppose to be faster and more efficent.

toniperic's avatar

@IvanBernatovic I'd just man up and use 5.2 with newest features that is supported ~6 months and, once 5.3 is out (and support for 5.2 is dropped), I'd simply upgrade to 5.3 and have the support again. Rinse and repeat for all the upcoming versions.

Above assumes you're not one of those developers who actually do stop learning at some point, or lose their will. If you are, then just stick with the latest LTS version.

btw. pozdrav iz Osijeka!

2 likes

Please or to participate in this conversation.