News Feed
Sections




News Archive
feed this:

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

HHVM Blog:
The Journey of a Thousand Bytecodes
October 06, 2014 @ 12:49:38

In the latest post to the HHVM (HipHop VM) blog Sara Golemon recounts the journey of a thousand bytecodes and the process that it takes to decompose a PHP file and optimize it for execution in the HHVM environment.

Compilers are fun. They take nice, human readable languages like PHP or Hack and turn them into lean, mean, CPU executin' turing machines. Some of these are simple enough a CS student can write one up in a weekend, some are the products of decades of fine tuning and careful architecting. Somewhere in that proud tradition stands HHVM; In fact it's several compilers stacked in an ever-growing chain of logic manipulation and abstractions. This article will attempt to take the reader through the HHVM compilation process from PHP-script to x86 machine code, one step at a time.

The process is broken down into six different steps, each with a description and some code examples where relevant:

  • Lexing the PHP to get its tokens
  • Parsing the token results into an AST (and optimizing it along the way)
  • Compilation to Bytecode
  • HHBBC Optimization
  • Intermediate Representation
  • Virtual Assembly
  • Emitting machine code
0 comments voice your opinion now!
hhvm bytecode process hiphop compile decode optimize

Link: http://hhvm.com/blog/6323/the-journey-of-a-thousand-bytecodes

AboutPerformance Blog:
How to Spruce up your Evolved PHP Application - Part 2
August 08, 2014 @ 10:57:51

On the About:Performance site today there's a new post (part two in the series, part one is here) about increasing the performance in your PHP application. In this new post he talks about a few other updates that can be made to make your app fly.

In the first part of my blog I covered the data side of the tuning process on my homegrown PHP application Spelix: database issues, caching on both the server and the client. [...] In this part, I will concentrate more on technical topics: network traffic, code caching and session handling.

The post shares helpful tips and code examples showing how to:

  • Reduce Network Traffic
  • Leverage Browser / CDN cache
  • Use Conditional and Non-Conditional Caching
  • Using the HTML5 Application Cache
  • Optimize Session Handling

He does suggest the use of a commercial tool for a more in-depth analysis, but there's nothing here that it's required for. A little poking around in your browser can yield most of the same results.

0 comments voice your opinion now!
application performance tips traffic cdn cache session optimize

Link: http://apmblog.compuware.com/2014/08/06/spruce-evolved-php-application-part-2/

Erika Heidi Reinaldo:
Optimizing Symfony applications on Vagrant boxes
September 25, 2013 @ 09:34:03

Ericka Heidi has a new post to her site today continuing on her theme of useful Vagrant advice with a look at optimizing Symfony applications on your Vagrant-managed instances.

A few months after I started playing around with Vagrant and Puppet, with smaller applications, I had the task to create a box for a Symfony app for the first time. I thought "all right, no problema! this will be a piece of cake, I already know the process, I just need to put it on puppet". And of course I was wrong.

Most of her problem revolved around performance - the Symfony applications were taking between 6 to 8 seconds to load. After trying several options (hardware and software), she narrowed it down to the overall I/O as the application was trying to access an NFS mounted directory for the "vendors" folder. She changed around the locations of some of the directories and was able to drop the page load times by quite a bit. She's posted the results of her work as a Vagrant file for easy download and use too.

0 comments voice your opinion now!
optimize symfony application vagrant instance vendor io performance

Link: http://www.erikaheidi.com/2013/09/24/optimizing-symfony-applications-vagrant-boxes/

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


PHPMaster.com:
Speeding Up Your CakePHP Websites
October 09, 2012 @ 10:08:19

PHPMaster.com has a new tutorial posted sharing a few helpful hints about speeding up CakePHP-driven sites to help squeeze the most performance out of your site.

By applying a few simple modifications, and even some more complex enhancements, CakePHP can be sped up quite a bit. By the time you work your way through even half of these changes, the performance of your your CakePHP site will be comparable to many other popular PHP frameworks, with the advantage that your development speed will never falter!

There's several tips in their list - some a bit more difficult to accomplish than others, but worth the results:

  • Upgrade CakePHP Versions
  • Disable Debug Mode
  • Disable Recursive Find Statements
  • Cache Query Results
  • Install Memory Based Caching
  • Removing Apache and Installing Nginx
  • Configure Nginx to use Memcached
  • Remove MySQL and Install Percona

For more information on the CakePHP framework, see the project's main site.

0 comments voice your opinion now!
cakephp website optimize performance tuning tips


PHPMaster.com:
The Need for Speed Profiling with XHProf and XHGui
September 03, 2012 @ 10:29:13

On PHPMaster.com today Matt Turland has an article posted about using XHProf and XHGui to find the performance issues in your application and profile them to help optimize things.

Profiling is the process of measuring the execution time of each function or method call involved in servicing a single page request. The data collected from this process can reveal issues such as a particular method taking a long time to execute or being called a large number of times. Profiling a PHP script generally requires installing a PHP extension. The two more popular extensions for this purpose are Derick Rethans' Xdebug and Facebook's XHProf. This article will focus on XHProf.

He walks you through the installation of both and shows you some sample results of the profiling of a simple application and how you can compare the results across profiling runs. Additionally, if you install graphviz support, you can generate the call stack output in a visual form to make for easier consumption.

0 comments voice your opinion now!
xhprof profile optimize xhgui tutorial install


Anson Cheung's Blog:
Optimize Web Site Performance by using YSlow
October 03, 2011 @ 11:12:08

In a recent post to his blog Anson Cheung guides you through another tool that can help you optimize your web applications - using YSlow for the frontend to detect trouble spots early (whether they're actually caused by the frontend or not).

He goes through the thirteen rules to help improve your website's performance including:

  • Make fewer HTTP requests
  • Gzip components
  • Make JS and CSS external
  • Remove duplicate scripts
  • Configure ETags

For more information about the YSlow extension (available for Firefox, Chrome, Opera and mobile devices), check out the project's page on Yahoo's Developer section (including ten more rules it checks).

0 comments voice your opinion now!
yslow optimize frontend performance extension browser rules


Anthony Ferrara's Blog:
On Optimization in PHP
August 10, 2011 @ 08:35:38

Anthony Ferrara has a new post to his blog today looking at something that's constantly a focus of user-facing applications, PHP ones or otherwise - application optimization. He specifically discusses handling it in PHP and some things to keep an eye out for.

When it comes to optimization, there are two competing viewpoints in the PHP community. Some say that optimization should only ever be an after thought and to avoid premature optimization at all costs. Others will say that this is impractical, and you should make your application fast as you write it, since then you won't have to go back and clean it up to make it faster. While I can understand the viewpoints of both sides, I am firmly in the former category.

He talks about the "90/10 Rule" of development (most of the work is done by only a small part of the code) and what that critical 10% could be made of. He also touches on the "60/40 Rule", "instinctual optimization" and the emphasis people put on benchmarks for their tool or framework of choice.

0 comments voice your opinion now!
optimize application opinion rule benchmark


Justin Carmony's Blog:
Working with Middle-Scale Websites
July 21, 2011 @ 11:53:08

In a new post Justin Carmony looks at what it means to me a "middle-scale website" and has some recommendations for anyone working with their applications and considering things like scalability, overcompensation and finding real results through profiling.

Hopefully at some point, your website is going to get a lot of traffic. Yay, you've reached your goal of getting good traffic, but it is soon followed by issues with performance and load. I like to call these the growing pains of a website. So as a web developer, I suddenly have the epiphany of "Hey, I need to scale my website!" What follows next is the biggest mistake a web developer can make: They start looking at articles on how Google scales, or maybe how Facebook manages all of their traffic. This is a mistake! To be brutally honest, you are not Google. You are not Facebook. You are not Twitter. You are a website that receives less than 0.000001% of the traffic that some of the major websites receive.

He includes a "reality check" of the setup behind a popular social site, StackExchange, with comments from their own post about their infrastructure. He talks about things included in a move to "middle-scale" like adding caching, performance tweaking, moving to a multiple server model and using replication.

0 comments voice your opinion now!
middle scale website application optimize performance profile


Fabien Potencier's Blog:
The PHP Ternary Operator Fast or not?
July 18, 2011 @ 10:35:36

In a new post Fabien Potencier looks at the ternary operator in PHP and wonders which is faster - using it or not (well, sort of...)

People like micro-optimizations. They are easy to understand, easy to apply... and useless. But some time ago, while reviewing pull requests for Twig, I read an interesting discussion about the performance of the ternary operator in PHP (thanks to @nikic for the investigation). Do you know which [example] snippet is the fastest (of course, they do exactly the same)? The right answer is: it depends.

He notes that it's all about the data being worked with. As some of his tests show (testing code included) there does end up being a difference between using it on a small and large dataset. After investigation, it was found that the ternary operator copies (copy-on-write) the value versus an "if" that just evaluates. He also mentions the new "?" version of the ternary syntax in PHP 5.3, but notes it still suffers from the same issue.

0 comments voice your opinion now!
ternary optimize speed dataset copyonwrite



Community Events





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


voicesoftheelephpant symfony framework laravel update security composer library version tool release series package introduction opinion install language interview podcast community

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