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

PHPMaster.com:
Practical Code Refactoring, Part 4 - Efficiency
November 01, 2012 @ 11:37:54

PHPMaster.com has posted the latest in their "Practical Code Refactoring" series , this time with a focus on efficiency and how you can refactor your code to help it perform better both in processing power and in resource use.

In part three of this series we dealt with refactoring code for extensibility and discussed logical extensibility, modular design, decoupling, and encapsulation. In this final part of the series, we discuss what the main concerns of efficiency are for your web application and how to refactor for better efficiency.

They talk about some of the things you can do about network bandwidth usage, memory inefficiencies and processing issues (over you doing more work than you need to?). These aren't code examples - every application is different when it comes to this stuff, but it gives you some good questions to ask to fill in the blanks.

0 comments voice your opinion now!
efficiency code refactor series processing resource usage


Brandon Savage's Blog:
Stop Sacrificing Readability For Efficiency!
March 27, 2009 @ 12:58:28

Brandon Savage has a recommendation fro developers out there - sometimes readability is more important than any micro-efficiency you might gain in your scripts.

Much was made last week over the topic of micro optimization in PHP. Most of these argued that micro optimization was a bad idea. [...] There's another reason that micro optimization can be a bad choice: it makes code absolutely impossible to read!

He points out one example for validating the length of a string in two ways - one using isset to tell which characters in a string are set and the other using the tride and true call to strlen. The first, while benchmarked to give you a (very tiny) improvements, is harder to read at first glance than the check to the string length.

0 comments voice your opinion now!
readability efficiency performance microoptimizations benchmark


Brandon Savage's Blog:
Hitting the Database Less Quick and Dirty Strategies for Database Efficiency
November 17, 2008 @ 11:04:24

In this new post to his blog, Brandon Savage looks at a few methods you can use to help reduce the overhead connecting to the database can cause.

Below are a list of my top five quick-and-dirty strategies for improving database performance in web applications. These suggestions are culled from recent experience and mixed with some ideas that I've implemented in my own code. They're not high level, but they are something we need consistent reminders about.

Here's the short version of the list:

  • Try caching
  • Reduce the number of queries that run
  • Use indexes
  • Optimize data usage
  • Avoid functions in WHERE statements

You'll have to check out his post for the full versions, though.

0 comments voice your opinion now!
strategy database efficiency tip list cache index optimize where



Community Events





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


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

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