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

Acquia Blog:
PHP is getting Faster
Nov 04, 2014 @ 13:35:29

On the Acquia blog they've posted another in their guest post series, this time from Richard Miller, a Senior Technical Consultant with SensioLabs (the people behind the Symfony framework). In this new post he talks about how the performance of PHP is getting better and why.

PHP is not the fastest language in which we could write web applications, yet we continue to do so for many other reasons. Pure speed of a language is rarely the main deciding factor for many projects. [...] So why worry about the speed of the language at all? Well, application architecture is improving and we are finding ways to avoid all those other bottlenecks. [...] Trying to gain speed through profiling and optimising code can be a long and tedious process. Thankfully, improvements in the speed of the language itself give us an improvement in these other areas for free.

He looks at "a brief history" of the language and the major milestones that have lead to the biggest performance gains over the years. He also talks about some of the alternatives out there to "normal PHP" for execution including the HHVM and HippyVM projects. He ends the post with a warning, though - be careful of fragmentation and separation of the community based on these different tools and embrace things like the language specification to keep things on an even keel.

tagged: community acquia faster performance history runtime projects

Link: https://www.acquia.com/blog/php-getting-faster

PHPClasses.org:
Can .NET make PHP run faster than the official PHP implementation?
Dec 15, 2011 @ 09:03:31

On the PHPClasses blog today the question is posed "can .NET make PHP run faster than the official PHP implementation?" (relating to the use of the Phalanger tool to compile PHP down to .NET assemblies.

Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and proposed to switch the official PHP implementation based on Zend for another based on Phalanger.

The post includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around 2 seconds faster (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.

tagged: dotnet faster request benchmark official phalanger

Link:

Kevin van Zonneveld's Blog:
Revisiting Faster PHP Sessions
May 06, 2011 @ 10:49:23

Kevin van Zonneveld has a new post to his blog revising an older post talking about session management with PHP and how limit the resources needed by them. In this post he points out another method - holding the sessions in RAM rather than on disk.

sing 2007 article Create turbocharged storage using tmpfs, we can defeat some of this over-engineering and take a simpler approach to speeding up sessions in PHP. We'll store them decentralized in memory by mounting RAM onto the existing /var/lib/php5 session directories throughout your application servers, which I will call nodes from now on.

He includes the commands you'll need to make a directory live in the RAM of your machine and how to migrate the existing sessions to this new data store. He covers some of the advantages of this approach (including that there's "less tech" involved so it's easier to manage). There is one point of failure he points out - that it wouldn't be a solution you could use for websites that might need to bridge sessions across machines.

tagged: faster sessions ram resource decentralize

Link:

DZone.com:
Java PHP Python -- Which is "Faster In General"?
Jan 07, 2011 @ 12:17:55

On the Java DZone.com section today there's a "which is faster" post comparing PHP, Java and Python. No, it's not quite what you're expecting - I'd suggest reading on.

Sigh. What a difficult question. There are numerous incarnations on StackOverflow. All nearly unanswerable. The worst part is questions where they add the "in general" qualifier. Which is "faster in general" is essentially impossible to answer. And yet, the question persists. There are three rules for figuring out which is faster. And there are three significant problems that make these rules inescapable.

His three rules are:

  • Languages don't have speeds. Implementations have speeds.
  • Statistics Aren't a Panacea.
  • Benchmarking Is Hard.

He seems to hit most of the issues with these sort of "faster" posts up front and notes that, while benchmarks can be run on a lot of different aspects about the languages, the results depend on how you slice it. His suggestion is, instead, to not try to compare the languages in a grand sense. Take each of them and compare them on specific tasks and let those results stand alone. Each of the three languages is going to be better at something than the other two.

tagged: benchmarking python java faster implementation

Link:

Josh Holmes' Blog:
Making PHP faster on IIS
Apr 07, 2010 @ 12:41:03

Josh Holmes (a Microsoft Evangelist) recently gave a presentation about getting PHP applications, specifically WordPress to work better on a Windows-based platform (whether it be running on a physical server or something like Azure).

I talked about the amazing improvements in FastCGI over the past few years, the Web Application Gallery and Web Platform Installer (WebPI), URL Redirect, WinCache and many other things that Microsoft is doing to embrace open source technologies.

The slides for the talk are over on Slideshare but if you want something a little more engaging, check out the webcast from php|architect this coming Friday (April 9th) by Mark Brown and Ruslan Yakushev on the same subject.

tagged: faster iis windows slide webcast joshholmes

Link:

Paul Jones' Blog:
Lazyweb Request: Why would PHP be *faster* than HTML?
Feb 20, 2009 @ 09:31:14

While running some benchmarks on some of the more popular PHP frameworks, Paul Jones came across something interesting - a PHP request was handled faster than a static HTML request.

With the help of the great guys at Slicehost.com, I am attempting to run my benchmark series on a virtual private server, to compare with EC2. However, I’m seeing a very strange result for the baselines: a PHP page delivers more requests-per-second than a static HTML page.

According to his results, his runs of ab (the Apache benchmarking tool) showed that requests against the index.html file (versus the index.php) came in at almost 400 requests per second slower. As it turns out, though, the problem of the skewed results wasn't in the serving up of the requests but in the ab tool itself. He picked up another testing tool, seige, and ran that with the same requests and got more correct results.

tagged: html faster benchmark framework test slicehost ubuntu apache ab

Link:

Etienne Kneuss' Blog:
SplFastArray to speed up your PHP arrays
Jun 09, 2008 @ 12:54:04

Etienne Kneuss has posted about a new part of the Standard PHP Library that creates arrays that are up to thirty percent faster than normal methods - SplFastArray.

Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it's indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size.

The code sample shows the setting of the size for the array (and changing it) with a var_dump of the output result. This method is always faster than normal arrays, it just varies how much from system to system (anywhere from ten to thirty percent).

tagged: spl splfastarray set size speed faster

Link:

Nick Halstead's Blog:
Do faster typists make better coders?
Jul 25, 2007 @ 14:51:04

Nick Halstead asks an interesting question on his blog today - "Do faster typists make better coders?"

I have been able to touch type since about age 12 and can manage about 100 words per minute when faced with blocks of text to copy and even faster if I am just writing code. [...] Programming in C meant a lot more typing of parenthesis and a lot more thinking about the structure of the code.

PHP has introduced another set of typing problems with a lot more use of < > and a much higher mixture of variables/functions/parenthesis plus the added bonus of trying to remember a single function from a choice of 3000+.

Several of the comments on the post suggest that it could be helpful to productivity, but shouldn't be focused on too much. After all, what really matters is the programmers skill, right?

tagged: faster typist better coder productive typing problem faster typist better coder productive typing problem

Link:

Nick Halstead's Blog:
Do faster typists make better coders?
Jul 25, 2007 @ 14:51:04

Nick Halstead asks an interesting question on his blog today - "Do faster typists make better coders?"

I have been able to touch type since about age 12 and can manage about 100 words per minute when faced with blocks of text to copy and even faster if I am just writing code. [...] Programming in C meant a lot more typing of parenthesis and a lot more thinking about the structure of the code.

PHP has introduced another set of typing problems with a lot more use of < > and a much higher mixture of variables/functions/parenthesis plus the added bonus of trying to remember a single function from a choice of 3000+.

Several of the comments on the post suggest that it could be helpful to productivity, but shouldn't be focused on too much. After all, what really matters is the programmers skill, right?

tagged: faster typist better coder productive typing problem faster typist better coder productive typing problem

Link:

Symfony Blog:
Make your symfony application 70% faster
May 21, 2007 @ 13:41:00

Continuing in their "plugin of the week" series, the Symfony blog presents a new plugin that can help to make your Symfony application up to 70 percent faster than it already is.

I'd like to tell you a little success story about using sfOptimizerPlugin. I did many things in my "public" application to optimize performance [and end up having] an average execution time of ~150ms per page, wich leads to ~100ms in the production environment. A little bit slow, I think.

After [installing the plugin and] running $php symfony optimize public staging over the environment, the execution time was reduced by 50ms from ~150ms down to ~90ms, nice. And even the production environment acts faster now, with only ~30ms to serve pages, very nice - 70% faster!

He even suggests using the sfOptimizerPlugin in a cron job on a server to help keep things constantly optimized.

tagged: symfony application faster plugin sfoptimizerplugin symfony application faster plugin sfoptimizerplugin

Link: