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

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/

SitePoint PHP Blog:
Apache vs Nginx Performance: Optimization Techniques
Jun 15, 2018 @ 12:22:11

On the SitePoint PHP blog they've posted a tutorial from author Tonino Jankov sharing some techniques you can use to increase the performance of Apache and Nginx when serving up your web applications.

The article starts with some of the basics, introducing both the software and some of the concepts around their use and evaluation:

  • an introduction to Apache and Nginx
  • hardware considerations
  • monitoring
  • testing the systems (benchmarking)

It then starts on the tuning tips, one section for each of the web servers. For Apache it covers changes for the mpm modules, disabling htaccess and browser cache control with mod_expires. On the Nginx side, they mention changing the number of workers created, tuning the keepalive timout and setting up server-side caching.

tagged: apache nginx performance optimize tip tutorial configuration

Link: https://www.sitepoint.com/apache-vs-nginx-performance-optimization-techniques/

Laravel News:
Speed Up Laravel on Top of Swoole
May 07, 2018 @ 10:47:09

On the Laravel News site there's a tutorial posted showing you how to use the Swole extension to speed up your Laravel-based application. Swole is a PHP extension written in C that provides missing asynchronous functionality to the language.

Swoole is a production-grade async programming framework for PHP. It is a PHP extension written in pure C language, which enables PHP developers to write high-performance, scalable, concurrent TCP, UDP, Unix socket, HTTP, WebSocket services in PHP without too much knowledge of the non-blocking I/O programming and low-level Linux kernel. You can think of Swoole as something like NodeJS but for PHP, with higher performance.

The post covers the "why?" question of using Swoole with Laravel, explaining how the traditional PHP request flow works. Swoole provides a way to reduce come of this processing overhead and increase performance. They then help you integrate Swoole and Laravel using a custom package (swooletw/laravel-swoole), installing both the package and using PECL to install the Swoole extension. Once the extension is enabled and the service provider is added, all it takes is an artisan command to start the web server up.

The post finishes with some quick benchmarks using wrk comparing it against a typical Nginx setup with PHP-FPM. Not surprisingly, Swoole outperforms the other setup well.

tagged: laravel swoole extension performance tutorial package install

Link: https://laravel-news.com/laravel-swoole

Symfony Finland:
MySQL 8.0 released with new features and improved performance
Apr 25, 2018 @ 11:57:45

On the Symfony Finland site they cover a recent announcement from MySQL about the release of their latest version: MySQL 8.0. In this post they cover some of the new features and performance improvements that come with this new version.

The MySQL development team has announced the General Availability of the MySQL 8.0.0 Open Source database.

This is the version following MySQL 5.7 that was released in late 2015 with interesting features like extensive JSON field support. Plenty of work has gone into this version as well and in an introductory post goes in-depth into all the enhancements.

The post includes a listing of eight topics (ironically) for the new updates including:

  • Support for Window functions, Common Table Expressions, NOWAIT and SKIP LOCKED, Descending Indexes, Grouping, Regular Expressions, Character Sets, Cost Model, and Histograms (SQL)
  • Geography support. Spatial Reference Systems (SRS), as well as SRS aware spatial datatypes, spatial indexes, and spatial functions.
  • Remote management, Undo tablespace management, and new instant DDL.
  • OpenSSL improvements, new default authentication, SQL Roles, breaking up the super privilege, password strength, and more.

Check out the rest of this post for more of the overview or MySQL's official announcement for the full details.

tagged: mysql8 release feature overview performance database

Link: https://symfony.fi/entry/mysql-8-0-released-with-new-features-and-improved-performance