Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Speeding Up PHP with OPcache in Docker
Dec 05, 2018 @ 10:16:51

The Laravel News site has a new tutorial posted showing how to speed up your PHP execution when developing with Docker by making use of the OPCache functionality.

If you’re on Docker for Mac or Docker for Windows, you might see some noticeable slowness and time to the first byte (TTFB) depending on your application’s setup. One of the most important things you can do to improve performance is enabling the OPCache module (regardless of the development environment). There are other things like volume caching (if possible), but OPcache is a win that you want in any environment you’re running PHP applications.

The tutorial starts by sharing a basic Opcache configuration, setting values for timestamp validation, memory consumption, and fast shutdown. These values are static and not very flexible so they change things up by making them able to be set as a part of the Docker build process. The post includes the changes you'll need to make to your Docker configuration to make this setup work in two ways: either copying the file in on build or making use of environment variables to set the configuration options at runtime.

tagged: opcache docker tutorial speed performance configuration

Link: https://laravel-news.com/php-opcache-docker

Phoronix:
PHP 7.3 Performance Benchmarks Are Looking Good Days Ahead Of Its Release
Dec 04, 2018 @ 11:14:30

Phoronix has a new post to their blog sharing some benchmark results for PHP 7.3, the next major language release, and things are looking positive!

Released on Thursday was PHP 7.3 RC6 as the last planned pre-release for the upcoming PHP 7.3. Here are some benchmarks looking at the PHP 7.3 performance compared to PHP releases going back to the v5.5 series on a Linux server.

[...] I ran some fresh benchmarks over the past day on PHP 5.5.38, PHP 5.6.38, PHP 7.0.32, PHP 7.1.24, PHP 7.2.12, and the PHP 7.3.0-RC6 test release. [...] PHP 7.3 is just shy of 10% faster than PHP 7.2 in the popular PHPBench. PHP 7.3 is 31% faster than PHP 7.0 or nearly 3x the speed of PHP5.

The post includes more benchmarks that reinforce this same trend with both the Zend performance testing and their own testing framework.

Overall, PHP 7.3 is shaping up to be another notable upgrade to the PHP7 series for its continued performance improvements, the new PHP FFI interface, and other new additions for this PHP release due out in early December.
tagged: php73 performance benchmark results version language

Link: https://www.phoronix.com/scan.php?page=news_item&px=PHP-7.3-Performance-Benchmarks

CloudWays Blog:
PHP-FPM Cuts Web App Loading Times by 300%
Nov 16, 2018 @ 10:18:33

There's several ways to run PHP on various webservers out there and in a tutorial from the CloudWays blog they focus on one: using PHP-FPM and the performance gain it can give.

Speed matters. Our engineers are always looking at ways on improving the stack. One of the major objectives of our stack integrations is to improve the speed of the overall processes of our stack.

Keeping up with this practice, in a bid to increase speed of aspects of Managed Cloud Hosting coupled with constant improvements based on users feedback, Cloudways has now integrated PHP-FPM in all its servers. Owing to this integration, applications hosted on Cloudways servers are now going to perform up to 3x faster.

The post starts with a look at why to choose PHP-FPM and shares some benchmarks of it in use versus the more typical mod_php shared module. It then gets into the implementation steps, linking to a step-by-step guide on how to implement it.

tagged: phpfpm performance tutorial installation benchmark

Link: https://www.cloudways.com/blog/php-fpm-on-cloud/

Hackernoon.com:
PHP is dead…Viva le PHP!
Nov 12, 2018 @ 11:04:25

In a recent post to the Hackernoon site, Sergii Shanin shares his take on the "PHP is dead" conversations and posts out there with the expected "Viva le PHP!" (long live PHP!) following it.

The fracas over Gutenberg and WordPress is the latest installment in the death of PHP. Take a deep breath everybody. Let’s ignore the trolls and take a look at what Mark Twain, Fidel Castro and PHP have in common?—?and more to the point, why PHP is still a reasonable choice for startups and small businesses.

t looks like ‘PHP is dead’ blog posts started cropping up in 2011 (let me know if you find older ones). If you search around Medium and the coding bootcamps that are popping up like mushrooms, the only common denominator is that everyone hates on PHP or simply ignores it. Apparently, it’s impossible to code in PHP with an oiled beard and ironic t-shirt while drinking overpriced coffee.

He shares two of the most wide-spread myths about PHP - that it's slow and that it can't scale - and dispels them. He then goes through some types projects where PHP "shines" including content driven websites and e-commerce sites. He shares some the "business sense" around choosing PHP, the perspective senior PHP developers bring to teams and projects, and the seeming "nine lives" of PHP.

tagged: language community scale speed performance business cost opinion

Link: https://hackernoon.com/php-is-dead-viva-le-php-f5dc5eb5c9c4

Blackfire.io Blog:
"Getting Started" Webinars Announced
Oct 24, 2018 @ 11:18:34

Blackfire.io, the PHP performance profiling service, has announced a series of webinars aimed to help you learn more about the service and how it can help you get the most out of your code. These webinars are spread out all across the globe so anyone can attend at a timezone-appropriate hour.

Here's the list for the October and November sessions:

You can find out more about the contents of each sessions - "Getting Started with Blackfire", "Introduction to Blackfire" and "Automating Performance Testing with Blackfire" - by clicking on the link for the related event. If you're interested at all in improving the performance of your application, check one of these webinars out. Blackfire offers their "Hack" level of support to try out for free too so there's no reason not to give it a shot!

tagged: blackfire profile performance service webinar announcement

Link: https://blog.blackfire.io/events/category/webinar

Delicious Brains:
Improve Page Load Time For Your WordPress Site With WP Offload S3: A Case Study
Aug 08, 2018 @ 09:45:48

On the Delicious Brains site there's a new tutorial posted for the WordPress users out there sharing a case study of the performance impact of WP Offload S3 on the average page load time.

One of the great things about working at Delicious Brains is working on products that I use and love outside of work. I was a WP Migrate DB Pro customer well before joining the team and still use it daily on personal sites and side projects. However, I’ve not often had the need to use our other plugin, WP Offload S3 to offload site media files to Amazon S3.

The post starts with some of the background on why the author chose the WP Offload plugin in the first place and what features it provided. The tutorial then walks you through the installation process and how to have assets served up by Cloudfront correctly. It also includes some things you should consider when figuring out if this setup is for you. It then wraps up with some benchmarks of the results post-implementation, seeing a decrease of almost a second off of the previous page load time.

tagged: wordpress tutorial page load performance timing wpoffloads3 plugin

Link: https://deliciousbrains.com/improving-page-load-time-wordpress/

Frederick Vanbrabant:
What Performance Tricks Actually Work
Jul 25, 2018 @ 09:55:24

Frederick Vanbrabant has a new post to his site sharing some performance tips you can integrate into your PHP code to help improve its overall processing time. He also talks some about a few that are just myths and debunks them.

We’ve all been there before, you submit a pull request and moments later you get a comment like: “Hey you should use a native function here, they are so much faster” or “You can declare this final, that way we save some processing power”.

It’s great that we as developers keep an eye on this, but how true are these thing. And are they still a thing in newer PHP versions?

He goes through a list of ten tricks that have been widely shared and creates some simple benchmarks around their use:

  • single versus double quotes
  • JSON handling versus XML handling
  • speed difference from using layered objects
  • native array functions versus loops
  • fetching an array item by quoted ID versus just ID
  • performance difference of throwing exceptions
  • impact of unused variables
  • magic methods versus normal methods
  • final versus non-final classes
  • comments in code

For each of the items in the list he includes the example code he used for the benchmark and the output from the PHPBench tool.

tagged: performance trick development tutorial

Link: https://frederickvanbrabant.com/2018/07/24/php-performance.html

SitePoint PHP Blog:
How To Boost Your Server Performance With Varnish
Jul 06, 2018 @ 09:20:23

The SitePoint PHP blog has posted the latest tutorial in their series creating a simple image gallery application with a focus on performance. In this latest article they cover the use of Varnish for output and page caching.

According to Pingdom.com, a company focused on web performance, in 2012 Varnish was already famous among the world’s top websites for its capacity to speed up web delivery.

[...] Although there are other solutions that also shine, Varnish is still a go-to solution that can dramatically improve website speed, reduce the strain on the web application server’s CPU, and even serve as a protection layer from DDoS attacks. KeyCDN recommends deploying it on the origin server stack.

Varnish can sit on a dedicated machine in case of more demanding websites, and make sure that the origin servers aren’t affected by the flood of requests.

The article starts by explaining a bit about how Varnish (and caching in general) works to help improve the performance for the end user. It also goes through some of the basics feature of Varnish including threaded executions, extensibility and its domain-specific language. The tutorial then walks you through the installation of Varnish on a linux-based machine and shares some example stats showing the difference between normal requests and when Varnish is enabled for the image gallery application.

tagged: server performance varnish tutorial series imagegallery optimization

Link: https://www.sitepoint.com/how-to-boost-your-server-performance-with-varnish/

SitePoint PHP Blog:
Improving Performance Perception: On-Demand Image Resizing
Jul 03, 2018 @ 12:08:20

The SitePoint PHP blog has continued their series covering the creation of an online image gallery application. The series has included several tutorials covering performance and optimization improvements. In this latest article they continue that trend focusing on optimizing the resizing of the images.

We’ve been building a sample application — a multi-image gallery blog — for performance benchmarking and optimizations. At this point, our application serves the same image regardless of the resolution and screen size it’s being served in. In this image resizing tutorial, we’ll modify it to serve a resized version depending on display size.

They start by listing out the requirements for the improvement: make all images responsive and the addition of the code to generate the resized image. Next it discusses the state of responsive images on the web and shows the first additions to the templates for the "srcset" value. They create some helper methods in Twig to get the image URL and "srcset" value. Next up, the tutorial helps you install the league/glide package and use it to create a script to manually "serve" the resized image information back to the user.

tagged: performance image resize tutorial series ondemand

Link: https://www.sitepoint.com/improving-performance-perception-on-demand-image-resizing/

SitePoint PHP Blog:
PHP-level Performance Optimization with Blackfire
Jun 22, 2018 @ 11:49:40

On the SitePoint PHP blog they've posted a tutorial that continues their series covering the creation of a simple image gallery blog application. In this latest part of the series the author covers the use of the Blackfire.io service for performance testing.

Throughout the past few months, we’ve introduced Blackfire and ways in which it can be used to detect application performance bottlenecks. In this post, we’ll apply it to our freshly started project to try and find the low-points and low-hanging fruit which we can pick to improve our app’s performance.

If you’re using Homestead Improved (and you should be), Blackfire is already installed.

While it’s useful to be introduced to Blackfire before diving into this, applying the steps in this post won’t require any prior knowledge; we’ll start from zero.

The tutorial walks you through some of the basics of Blackfire and what kind of information it will report back. After a small change to the Homestead YAML configuration, they show how to profile the landing page and what the resulting graph looks like. It then goes through the code, finding each of the pain points and refactoring them to improve performance.

tagged: blackfireio series performance optimize tutorial

Link: https://www.sitepoint.com/php-level-performance-optimization-blackfire/