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

SitePoint PHP Blog:
Memory Performance Boosts with Generators and Nikic/Iter
Oct 20, 2015 @ 14:31:24

On the SitePoint PHP blog there's a tutorial posted showing you how to get some performance gains in your PHP applications using the "Iter" library from Nikita Popov.

First came arrays. Then we gained the ability to define our own array-like things (called iterators). But since PHP 5.5, we can rapidly create iterator-like structures called generators. These appear as functions, but we can use them as iterators. They give us a simple syntax for what are essentially interruptible, repeatable functions. They’re wonderful!

And we’re going to look at a few areas in which we can use them. We’re also going to discover a few problems to be aware of when using them. Finally, we’ll study a brilliant library, created by the talented Nikita Popov.

They start with a common problem: loading information line-by-line from a CSV file. They do some filtering and merging of the values but point our a major flaw - large files. These would drag down performance quite a bit and generators might just make for a good solution. He shows a simple "read CSV" generator to get the lines in the file while also reducing the memory needed. Unfortunately the array_map/array_filter methods he was using for sorting don't work with generators. The nikic/iter helps fix this. Code examples are included showing it in use performing the same operations as before. He ends the post with a few other "fun things" including array flattening, slicing and rewinding generators.

tagged: memory performance boost generator nikic iter library tutorial

Link: http://www.sitepoint.com/memory-performance-boosts-with-generators-and-nikiciter/

Ibuildings Blog:
Boost performance with parallel processing
Jan 23, 2009 @ 13:51:05

On the Ibuildings blog today there's a new post from Martin Roest looking at parallel processing in PHP scripts and how it can help you with performance and simplifying your applications.

The idea of parallel processing is when you take an atomic transaction or operation called a 'process' and run a couple of those at the same time. [...] In this example I had a PHP CLI script. The purpose of this script was to process remote documents and save it local. It fetched the document from a remote location, processed it and saved the result local - let's call this the transaction. Transactions were done sequentially. It took about 1 second for a transaction to complete and the script had to do roughly 3500 transactions.

Obviously, this script/testing method was not very effective, so he went searching for an alternative. The best option came in the shape of forking processes - spawning off a separate script (via PHP's forking functionality) to do the work on one or multiple entries. It uses the pcntl_fork and pcntl_waitpid functions to spawn and manage these children. Once they're all finished - working in parallel - they return back to the main script to wait for the slower ones to catch up.

tagged: performance boost parallel processing ibuildings fork pcntlfork pcntlwaitpid

Link:

SymbianOne.com:
Your S60 Web server gets a boost
Dec 21, 2007 @ 17:14:00

Michael Kimsal points out an article posted recently concerning a new feature of the Symbain OS for mobile phones - a web server that could support PHP and MySQL.

From the article:

Jukka on the S60 Blogs is reporting that PHP and mySQL are going to be available for S60 devices in early 2008. [...] I (Johan Wikman) can now reveal that we at the CCNC conference in Las Vegas in January, 2008 will demonstrate and release what we call the PAMP stack.

The PAMP stack stands for "Personal Apache, MySQL, PHP" and will be included in the S60 smartphones and makes it possible to install most PHP applications (that use MySQL) right off the shelf. Developers of several GTD-type applications are reported to already be in testing on the new platform.

tagged: s60 webserver boost pamp apache mysql install moblie device s60 webserver boost pamp apache mysql install moblie device

Link:

SymbianOne.com:
Your S60 Web server gets a boost
Dec 21, 2007 @ 17:14:00

Michael Kimsal points out an article posted recently concerning a new feature of the Symbain OS for mobile phones - a web server that could support PHP and MySQL.

From the article:

Jukka on the S60 Blogs is reporting that PHP and mySQL are going to be available for S60 devices in early 2008. [...] I (Johan Wikman) can now reveal that we at the CCNC conference in Las Vegas in January, 2008 will demonstrate and release what we call the PAMP stack.

The PAMP stack stands for "Personal Apache, MySQL, PHP" and will be included in the S60 smartphones and makes it possible to install most PHP applications (that use MySQL) right off the shelf. Developers of several GTD-type applications are reported to already be in testing on the new platform.

tagged: s60 webserver boost pamp apache mysql install moblie device s60 webserver boost pamp apache mysql install moblie device

Link:

Greg Beaver's Blog:
phar gets a major speed boost with version 1.2.1
Aug 30, 2007 @ 14:06:00

Greg Beaver has blogged about an enhancement in the latest release of phar (1.2.1) - a major speed boost:

A few minutes ago, I released phar version 1.2.1. phar is a PHP extension that allows the creation of complete filesystems within a single physical file. In addition, a bootstrap stub written in PHP can be used to run a phar archive as if it were an executable file or shell script. Documentation on its usage and how to create phars is at http://php.net/phar in the PHP manual.

Greg mentions some other issues that were fixed and a refactoring of some of the stream operations to cut the speed in half.

tagged: phar archive pear pecl package release speed boost phar archive pear pecl package release speed boost

Link:

Greg Beaver's Blog:
phar gets a major speed boost with version 1.2.1
Aug 30, 2007 @ 14:06:00

Greg Beaver has blogged about an enhancement in the latest release of phar (1.2.1) - a major speed boost:

A few minutes ago, I released phar version 1.2.1. phar is a PHP extension that allows the creation of complete filesystems within a single physical file. In addition, a bootstrap stub written in PHP can be used to run a phar archive as if it were an executable file or shell script. Documentation on its usage and how to create phars is at http://php.net/phar in the PHP manual.

Greg mentions some other issues that were fixed and a refactoring of some of the stream operations to cut the speed in half.

tagged: phar archive pear pecl package release speed boost phar archive pear pecl package release speed boost

Link:

ThinkPHP Blog:
Performance boost for ZendStudio Windows
Jul 31, 2007 @ 15:20:00

According to another (German) blog entry as pointed out on the ThinkPHP blog, it's possible to get a performance boost for Zend Studio on Windows with a few mouse clicks.

According to this blog entry (sorry, German), you may improve Zend Studio's editor performance by switching off the option "Use OS Look and Feel" (at Tools > Preferences, tab "Desktop", option "Use OS Look and Feel").

According to the comments on the post, this seems to work well.

tagged: performance boost zend studio windows java interface performance boost zend studio windows java interface

Link:

ThinkPHP Blog:
Performance boost for ZendStudio Windows
Jul 31, 2007 @ 15:20:00

According to another (German) blog entry as pointed out on the ThinkPHP blog, it's possible to get a performance boost for Zend Studio on Windows with a few mouse clicks.

According to this blog entry (sorry, German), you may improve Zend Studio's editor performance by switching off the option "Use OS Look and Feel" (at Tools > Preferences, tab "Desktop", option "Use OS Look and Feel").

According to the comments on the post, this seems to work well.

tagged: performance boost zend studio windows java interface performance boost zend studio windows java interface

Link:

Dave Dash's Blog:
Boosting terms in Zend Search Lucene
May 30, 2007 @ 13:49:00

On the SpinDrop blog today, Dave Dash continues his look at the Lucene search engine for the Zend Framework with this new post showing how to boost certain terms' relevance in the search results.

Lucene supports boosting or weighting terms. For example, if I search for members of a web site, and I type in Dash, I want people with the name Dash to take precedence over somebody who has a hobby of running the 50-yard Dash.

He shows how to, with the help of a few simple lines of PHP code added to your application, you can easily boost terms based on field by whatever multiplier you choose.

tagged: boost term result search lucene zendframework zendsearch boost term result search lucene zendframework zendsearch

Link:

Dave Dash's Blog:
Boosting terms in Zend Search Lucene
May 30, 2007 @ 13:49:00

On the SpinDrop blog today, Dave Dash continues his look at the Lucene search engine for the Zend Framework with this new post showing how to boost certain terms' relevance in the search results.

Lucene supports boosting or weighting terms. For example, if I search for members of a web site, and I type in Dash, I want people with the name Dash to take precedence over somebody who has a hobby of running the 50-yard Dash.

He shows how to, with the help of a few simple lines of PHP code added to your application, you can easily boost terms based on field by whatever multiplier you choose.

tagged: boost term result search lucene zendframework zendsearch boost term result search lucene zendframework zendsearch

Link:


Trending Topics: