Monday, October 8, 2012

A Look at PHP Accelerators

One of today’s most popular server-side scripting languages that many web programmers use in web development is PHP. And there are many reasons why many had preferred the use of PHP rather than the use of other types of server-side scripting languages, such as Microsoft’s ASP. These reasons include the PHP accelerator.


https://www.myoptimind.com/web-design-company-philippines/


What is a PHP Accelerator?

A PHP accelerator is a PHP extension designed to improve the performance of software applications written in the PHP programming language. 

According to many php developers experts, most PHP accelerators work by caching the compiled bytecode of PHP scripts to avoid the overhead of parsing and compiling source code on each request (some or even most of which may never be executed). To further improve performance, the cached code is stored in shared memory and directly executed from there, minimizing the amount of slow disk reads and memory copying at runtime. 

Advantages PHP accelerators can substantially increase the speed of PHP applications. Improvements of web page generation throughput by factors of 2 to 7 have been observed. 

The effect on application performance of opcode caching varies widely, depending on factors such as the inherent execution time of the PHP application and the percentage of source code actually executed on a given request, and whether additional optimization steps are performed. 

According to many web developer Philippines experts, while a code optimizer may even slow down overall performance when used in isolation, it can provide an additional performance boost when coupled with a bytecode cache, as the optimization effort is performed just once. 

A Popular Example of PHP Accelerator

eAccelerator is a PHP accelerator derived from the MMCache extension for the PHP programming language. eAccelerator provides a bytecode cache. eAccelerator is open source and thereby free to use and distribute. Old and unmaintained versions also provided an encoder. 

Every time a PHP script is accessed, PHP usually parses and compiles scripts to bytecode. Once installed, eAccelerator optimizes the compiled bytecode and caches this to shared memory or disk or both. Upon subsequent accesses to a script, eAccelerator will access cached bytecode if it is available instead of the script being compiled. This avoids the performance overhead of repeated parsing and compilation. 

Previous eAccelerator versions also provided functions for use in PHP scripts that allow access to shared memory, automatic web (content) caching, and other related tasks. These were removed as of version 0.9.6rc1. 

Old eAccelerator versions had an encoder component that creates a file that cannot be as easily read as a normal PHP script, offering some code protection. A dedicated extension named eLoader is available to process such encoded scripts if the eAccelerator extension is not desired. This functionality has been removed from the current developer version and will not be part of the next release.

Source: