Published 2 years ago by jasonb
Hi all! Has anyone started putting thought into using php 7 with Laravel 5.1? Since PHP 7 is based on the PHPNG, The performance gains realized from PHP 7 are huge! They vary between 25% and 70% on real-world apps, and all of that just from upgrading PHP, without having to change a single line of code!
To put things in perspective – when PHPNG was published, the WordPress homepage required approx. 9.4 billion CPU instructions to execute. As of now – it requires only 2.6 billion – that’s 72% less!
I am excited to see the performance of Laravel 5.1 running on php 7.
I know that Right now php 7 is only in the first stage ie 7.0.0 Alpha 1 Released but the road map shows that it will be prime time November of this year 2015.
What are your thoughts?
-J
Depends where the bottleneck is. Filesystem loading the files or is it in fact CPU from PHP.
Have you tested?
I am downloading it right now. Also Blackfire io https://blackfire.io/ you can sign up for free as it is in beta. Blackfire empowers all developers and IT/Ops to easily identify and understand performance bottlenecks, and find how to resolve them quickly based on accurate data.
-J
@jasonb I try php7 on Drupal 8 and find out huge performance improvement over php 5.5. It going to be good if we test laravel on php7 and report bugs to php community and Laravel community as well. So Laravel going to be good prepared for php7.
If to tell truth I moved to Golang year ago because tired of php speed issues and servers overloads behind overs languages. But news about php7 move me back :) I hear same pythonistas interested as well. So Laravel going to have great opportunity in 2016 year rise to heaven :)
@jasonb , @bashy found easy way install php7 php7.zend.com
Them provide nightly updates
It is amazing . I try on Symfony2 with page loaded 300000 elements end without cache take 145ms :)
Not bad at all. Drupal 8 still slowpoke on it :(.
@Codenator81 Cool, running on Debian Testing.
┌[bashy☮Luna]-(~)
└> cat /etc/debian_version
stretch/sid
┌[bashy☮Luna]-(~)
└> /usr/local/php7/bin/php -v
PHP 7.0.0-dev (cli) (built: Jun 25 2015 19:09:39)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
@bashy After small optimization Laravel index page (I have there lists of 10 elements) give 45-50ms on php7.
PHP 7 is real slow compared to PHP 5.6 on my local machine. Getting 150-200ms compared to 10-30ms on PHP 5.6 for my Laravel 5.1 project. Maybe I'm doing something wrong, but my excitement for PHP 7 went straight out the window :/
@coldKingdom I got different result on Windows machine than on Ubuntu. When I compare page load on Windows 8.1 where php 5.6 vs php 7 with server method. I got 95% less memory for php7 but 25% performance lost against php 5.6. P.S. Ups php 5.6 where on OpCache but php7 not.
Does Laravel work as is on PHP 7 or is there some code changes that have to be done please let me know.
Yes, even with new stuff PHP still has backwards compatibility. With laravel requirements being higher (new PHP version) then arguably most it works great. Benefit of Taylor being late to the PHP world!
Hey if you are still there does file uploads work the same or do you have to use that new PSR-7 spec way of doing file uploads? I'm referring to regular php file uploads not uploading in Laravel. Have you found a PHP 7 manual or documentation yet I can't wait till one comes out so I can start looking at it.
@coldKingdom You are getting exec times of 10-20ms!!!! Through a server? What server? Thats ~ 100x faster.
@jimmck hm yes I miss that 10-20ms on php 5.6!!! Cant be. Lavarel without code take 35ms for booting. With Eloquent littlemore. So plain page 70ms is great!! But 20ms is dream :)
@jlrdw Oficial documentation start to be updated for PHP 7 phptags
what-to-expect-php-7
but any way there not many breaking change at all. Most problem came with new reserved words like String. So same DB ORM if not updated and not rename String class going to warm critical error
As php7 eat less memory and work double faster I belive hosting became much cheaper
Please sign in or create an account to participate in this conversation.