News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Davey Shafik:
Everything You Need to Know About OpCode Caches
October 01, 2013 @ 10:49:48

Davey Shafik has a new post to his site today sharing everything you need to know about opcode caches, the mechanism that's works "behind the scenes" to cache the execution of the opcode paths for later reuse.

Last year I wrote a talk called "Fast, Not Furious: How to Find and Fix Slow Code" - a performance talk covering profiling, memcache and some other stuff. As I often do - to hedge my bets = I stuck a few slides on the end "just in case" I ran through everything too quickly and needed to fill in time. These slides were on APC, the Alternative PHP Cache, and went just a little into tokens and how APC works under the hood. I really enjoyed presenting those 6 slides, and I've been wanting to expand on that topic ever since then. Well, after a few weeks of hard work, some input from some great people, including Sara Golemon, Elizabeth Smith and Julien Pauli, I'm so very happy to publish PHP Performance I: Everything You Need to Know About OpCode Caches.

The result is published over on the Engine Yard Developer Center and has been made into a 20 minute screencast (with original slides here). He covers what they are, which ones are out there, the common execution cycle and what happens when the opcodes are cached.

0 comments voice your opinion now!
opcode cache presentation screencast guide tutorial apc zend opcache

Link: http://daveyshafik.com/archives/68838-everything-you-need-to-know-about-opcode-caches.html

Nikita Popov:
Order of evaluation in PHP
September 25, 2013 @ 10:51:35

If you're the kind of person that wonders more about the internals of PHP and how it works "under the covers" you'll find this new post from Nikita Popov a good read. It talks about how PHP handles its order of operations in more complex evaluation statements.

At this point many people seem to think that the order in which an expression is evaluated is determined by operator precedence and associativity. But that's not true. Precedence and associativity only tell you how the expressions are grouped.[...] What does this tell us about the order of evaluation? Nothing. Operator precedence and associativity specify grouping, but they do not specify in which order the groups are executed.

He gives a few examples to illustrate his point including multiple increments of the same variable at one time and how it's the "fault" of the compiled variables that were introduced in PHP 5.1. He shows the opcode version of the same PHP userland code and talks briefly about how to avoid this odd functionality in your application.

0 comments voice your opinion now!
order evaluation opcode compiled variable

Link: https://gist.github.com/nikic/6699370

Chris Jones:
Using PHP 5.5's New "Opcache" Opcode Cache
March 18, 2013 @ 09:42:55

Chris Jones has a new post to his Oracle blog today talking about the new "opcode" opcode caching that's going to be built into future PHP versions This is the implementation of the Zend Optimizer+ opcode caching in a native language interface. The latest PHP 5.5 snapshots have it included.

The new "opcache" can be seen as substitute for the venerable APC cache, the maintenance of which had become an issue. Note: although opcache is now readily available, there is currently nothing preventing you from using any available (working!) opcode cache in PHP 5.5.

He gives you a quick guide to getting this new opcode caching enabled and compiled into a shiny new download of the PHP 5.5.x branch. You'll need a special command line flag on the compile and to update your php.ini to load the needed shares module. You can also use it if you're on PHP 5.2 or higher either by compiling this source or using this PECL extension.

0 comments voice your opinion now!
opcode cache zendoptimizer install configure phpini pecl


Lukas Smith:
On predictable PHP release cycles
March 01, 2013 @ 09:37:52

Lukas Smith has a new post today about what he sees as an important part of PHP (or really most open source projects) - a predictable release cycle. It centers around the recent proposal to introduce the Zend Optimizer+ into the core and how it seems to be causing a delay with 5.5 (maybe up to 2 months).

What troubles me though is that its being proposed very late in the game for PHP 5.5, therefore causing a likely delay of 5.5 of at least about 2 months in the best case scenario if it were included. The other option of including it in 5.6 does not seem to be as popular at this point. This saddens me quite a bit since I believe that predictable release cycles would carry several advantages

He points out some things that come along with having predicability around the software releases like developers knowing when/if their changes will make it into the next release. It also makes it easier for end users to plan their releases of their own software, knowing when they'll be getting a feature. In this particular case, though, he doesn't quite understand the delay as the Zend Optimizer+ isn't a change to core, it's an addition:

What is even stranger for this case is that we are just talking about an extension here. Its not a language feature, there is no engine level integration. So even if its not added to core, people can easily get Optimizer+ via PECL. So in this case we are not talking about people having to wait another 10-11 months. Don't get me wrong I think getting an opcode cache into core is awesome, but the reality is that shared host users will probably still not have access to it [...] and the rest can still get it, albeit with a bit more effort.
0 comments voice your opinion now!
predictable release cycle zendoptimizer opcode pecl extension opinion


Zumba Engineering Blog:
Some CakePHP optimizations
November 07, 2012 @ 09:31:20

For those out there using the CakePHP framework to create your applications, you might be interested in these quick tips from Juan Basso on the Zumba Engineering Blog for both the architecture and actual code to optimize the performance of the app.

Our site and system has a lot of throughput and it make us use more instances and try to reduce the load in every part. It makes the company happy (save money) and also make the customer happy (faster load). On this article I will go over few things in terms of architecture and some code changes/strategies that could make your application faster as well.

Some of the recommendations include:

  • Installing the APC/opcode caching to help save execution time
  • Avoiding as many network requests as possible
  • Use local file/data caching
  • Using the "requestAction" inside controllers with its built-in caching
0 comments voice your opinion now!
cakephp optimize caching apc opcode file resource


DZone.com:
Using APC correctly
August 01, 2012 @ 11:09:52

In this new post to DZone.com, Giorgio Sironi shares a few helpful hints on using the APC tool to help improve the performance of your web applications.

APC (Alternative PHP Cache) is one of the orthogonal tools you can use to speed up the execution of PHP code. This article explains from scratch the correct use of APC's system cache (not touching the user cache, which is just a standard key/value map). APC has also other features like upload progress support, but the system cache is its main features and has such a little footprint on your code that you should throw an apc.php file to everyone picking on you for writing strings in single or double quotes.

He describes what the APC cache does for you (both on a lower, opcode and a higher, performance levels) and how it relates to the shared processes a web server uses. He finishes off the post with a quick guide to getting it installed and working ("pecl install") and some of the common settings to tweak to get the most of the functionality.

0 comments voice your opinion now!
apc install tutorial usage opcode cache perfromance


Anthony Ferrara:
The Anatomy Of Equals - Opcode Analysis
July 19, 2012 @ 10:11:48

Anthony Ferrara has a new post today getting into the details of how "equals" works in PHP at the opcode level. He focuses on the answer to a question he received:

I was asked an interesting question via email yesterday. The question is fairly simple. The answer, not so much... So, rather than reply in an email, I figured that I'd write a post about it instead. The question, simply stated, is: "When comparing a float to an integer using ==, where does the conversion happen?"

He starts with a super simple piece of test code that compares an integer (1) to a float (1.0) and walks through the process PHP takes to perform the comparison (with a double equals "=="). He talks about opcode handlers, the "fast equal function" and how it handles the casting from one type to another, C source highlights included.

0 comments voice your opinion now!
equals opcode source language cast variable


Derick Rethans' Blog:
Xdebug's Code Coverage speedup
September 23, 2011 @ 09:56:33

Derick Rethans has a new post to his blog today talking about some work that's been done to speed up XDebug's code coverage generation. Changes in the coming 2.2 release have some improvements that make things perform better and put less stress on PHP in the process.

Code coverage tells you how much of your code base is actually being tested by your unit tests. It's a very useful feature, but sadly, it slows down PHP's execution quite a lot. One part of this slowdown is the overhead to record the information internally, but another part is because I have to overload lots of opcodes. (Opcodes are PHP's internal execution units, similar to assembler instructions) They are always overloaded even if code coverage is not used, because it's only safe to overload them for the whole request.

These changes were from a combination of contributions from Taavi Burns and a new ini setting that will allow you to enable or disable the code coverage in XDebug. Benchmarking shows a good amount of time reduction in coverage runs - dropping anywhere from a few seconds to over a minute. He also mentions the idea of "modes", shortcuts to predefined settings for different types of reporting (like "profiling" or "tracing").

0 comments voice your opinion now!
xdebug codecoverage speed improvement opcode contribution benchmark


Brian Swan's Blog:
Performance Tuning PHP Apps on Windows with Wincache
July 11, 2011 @ 10:04:45

Brian Swan has a new post to his blog sharing some tips you can use to get the best performance out of your Windows applications by tuning Wincache.

A few weeks ago I wrote a post that showed how to improve the performance of PHP applications on Windows by using the IIS output caching module. Using the output caching module can have significant positive impact on application performance since pages are served from cache without executing any PHP code. However, this very strength can also be a drawback depending on how your application is built. Because entire pages are cached, using output caching may not be ideal for pages that have multiple data sources.

He points to the Wincache extension as an alternative to the full-page caching with it's built-in opcode caching (you get for "free" just by installing). He mentions this and a few other features that come with it like the ability to cache to a file and to normalize file paths for more efficient seeking of files. He also focuses on partial caching with a specific example of caching user data for use through out the application. A bit of code and some screenshots are included to show the performance boost this can give.

0 comments voice your opinion now!
performance wincache windows extension file opcode


Zend Developer Zone:
Using APC with PHP
November 02, 2010 @ 11:51:44

The Zend Developer Zone has published a new in-depth tutorial from Vikram Vaswani about using APC and PHP to get the best performance out of your application. Using this opcode caching tool can greatly speed up the execution of your site with almost no effort on your part.

dding APC to an application usually results in improved application response times, reduced server load and happier users. In this article, I'll introduce you to APC, guiding you through the process of installing and configuring it and showing you a few examples of how it works. I'll also walk you through the APC administrator interface, which lets you view APC performance in real time, and show you how you can use it with the Zend Framework

He shows you every step of the way - installation, configuration (complete with some screenshots) and the web-based interface you can enable to see the statistics about how the cache's performance is and what requests it's been handling. He mentions other abilities APC has like array and object caching, caching closures and finally a real-world example of using it to cache the results of a Twitter search request (in a Zend Framework environment).

1 comment voice your opinion now!
apc opcode cache tutorial optimize



Community Events











Don't see your event here?
Let us know!


performance package composer podcast opinion facebook symfony2 release framework unittest language database introduction install hhvm application security component overview hack

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework