After teaching math (and a little computer science) for 14 years, Brian changed careers in 2006 with the idea that getting out of his comfort zone would be good. So now he works as a writer and programmer at Microsoft who specializes in PHP and Windows Azure. Brian is a DZone MVB and is not an employee of DZone and has posted 82 posts at DZone. You can read more from them at their website. View Full User Profile

Why is PHP 5.3 on Windows faster than previous PHP versions?

  • submit to reddit

Last week I had the good fortune of hearing Rasmus Lerdorf speak at the Seattle PHP Meetup. His talks was excellent – it was sprinkled with history, personal stories, tips, best practices, and insights into what he’s thinking about for the future. At one point, during a section on best practices, he urged everyone to move to PHP 5.3 if they hadn’t already. He added (and I’m paraphrasing here), “If you aren’t running PHP 5.3 on Windows, you’re lucky…because you have a 40% performance boost coming.”

He clarified this by saying that, with some help from Microsoft, improvements were made in PHP 5.3 that led to a 40% performance improvement of PHP on Windows. Because he didn’t go into the details of why this performance boost was realized, I got questions in email the next day asking about why. So, here’s a slide from a presentation I did last year that explains why (I actually borrowed this slide from a presentation that Pierre Joye can see his complete presentation, which has more detail, here:


As you can see from the slide, there are 3 main reasons for the performance improvement:

  1. PHP 5.3 is compiled with the VC9 compiler (also known as the Visual C++ 2008 compiler).
  2. Rather than calling the POSIX abstraction layer in the Windows build of PHP, the Win32 API is called directly.
  3. PHP library management was improved in PHP 5.3.

Clearly, that’s the short answer, but it should give you some idea of why PHP 5.3 is 40% faster on Windows than previous versions of PHP.

Published at DZone with permission of Brian Swan, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Perrin Nicolas replied on Thu, 2012/01/05 - 1:43pm

Le navigateur vieillissant de Microsoft est certes obsolète. Mais il reste utilisé par beaucoup d'entreprises. Et ces dernières n'ont pas forcément d'énergie à dépenser pour basculer vers une version plus récente ou un autre navigateur. Google vient pourtant de décider pour elles. A compter du 1er mars, ses applications en ligne, les fameuses Google Apps ne fonctionneront plus – ou presque – avec ce trop microsoftien navigateur. livres poker

Rehman Khan replied on Sat, 2012/02/25 - 5:12am

Interesting. Now I understand the technical reasons why PHP 5.3 is not working on some old versions of Windows like 2k or XP with the first pack(s).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.