Laravel Octane vs Hyperf performance comparison
Vložit
- čas přidán 5. 09. 2024
- We puts these frameworks to the test with dynamic content and template rendering (I used twig for hyperF). This video showcases a head-to-head challenge, with both frameworks running similar applications designed to fetch and render data from a database. Using JMeter, we benchmark the performance, analyzing response times, error rates, and resource consumption.
I think that what the world deserves is a master comparison between Laravel Octane with FrankenPHP vs Swoole vs OpenSwoole vs Trongate vs NextJS vs SvelteKit vs NuxtJS. Your next video?
I believe the main problem concerning the debate against PHP and it's related frameworks is that, lot's of developers still see PHP as the PHP of 10-15 years ago, which causes them to make wrong judgements. PHP has evolved drastically and has really proven to be so stable and reliable. It has been able to stand the test of time with so so many server applications still running PHP.
The main problem of PHP and it's related frameworks they are still staying 10-15 ago. Look on Spiral Framework and you'll see that in performance aspect it's 10 times faster than Laravel or Symfony or hyperF because of model of request/response processing.
Spiral is vendor locked into RoadRunner - non starter for 95% of people.
Very happy to see a Tunisian covering these topics ♥
Thank you! 🇹🇳
loving your comparison videos. Would love to see inertiajs vs livewire
Thanks for sharing. The main difference between Laravel and Hyperf is concurrency. You won't see that with 100 concurrent users (both frameworks can handle that easily). It would be great if you can re-test with 1000 - 2000 concurrent users. That's where you should start seeing real differences.
Thanks for your comment! In my tests on AWS t2.micro servers (1GB RAM, 1 vCPU), both Laravel and Next.js maxed out at 100 concurrent users, reaching 100% CPU usage in the first second. Attempting 1000 users caused server freezing akin to a DOS attack.
@@code-for-me Yeah you'll probably need at least a 4GB / 4vCPU instance to test that. Swoole needs quite a bit of memory since it keeps the entire application booted in memory. 1GB doesn't leave a lot of room on top of that for requests.
You should test hyperf coroutine and swoole support of dbs and queues. Thats where it performs better.
Great Tunisian, nice comparison, greet from Indonesia 👍
Hie, what about Sveltekit vs Octane dynamic.. In my opinion having used both I think sveltekit will crush it.
I appreciate your input. I'll definitely consider it for my next test.
Try Spiral Framework with RoadRunner.
very strange results. I'm just looking for a replacement for Laravel because... he's slow. And in my test with a sample from the database (from one table), the results are completely different. DB - PostrgreSql 14. 10 000 requests with 100 connections. Laravel produced 199 per second, and Hiperf - 3435. Interestingly, Lumen (with swooletw/laravel-swoole) produced even more - 7670 per second
Interesting, in Laravel I used Octain, and that boosted the performance, also note that production environement need to be set and cache should be optimized for Laravel to be fast.
Try Spiral Framework.
Octane load the whole laravel script into memory, it terms of of performance it's doing well because it's in every request it load the script from memory not from the disk but what I can't understand is how is it that in this comparaison it doesn't consume a lot of memory ?
Can you please compare Laravel with Slim framework?
Thanks for your comment! You've raised an interesting point: why the memory usage remains stable even with added concurrent users, is indeed intriguing.
As per my current understanding, OpenSwoole loads and bootstraps the application in memory once for every worker, distributing subsequent requests among the workers. However, I acknowledge that a deeper dive into OpenSwoole's internals, including aspects like multiprocessing and process pooling, may be necessary for a more accurate and detailed answer.
Man, i really wanna learn laravel. I'm totally new to the programming.
recommend me a platform where i can master it super fast
Or should i learn it or not?
And if not then what?
I'm confused😕
Absolutely! Learning Laravel can be a valuable skill, a framework widely used in web development. Platforms like CZcams offer a wealth of Laravel tutorials for beginners.
My suggestion would be to start by learning the basics of programming, including algorithms. Once you're comfortable with fundamental programming concepts, diving into Laravel will be a smoother process.
@@code-for-me but laravel framework updates every year may be
@@ra_editz9445 Google for Laracasts. Most courses require subscription, but some of them are open. Great way to start for PHP/Laravel and everything around.