Optimizing PHP

by John H
~1 minute

This post will probably be changed and edited as I learn more. I'm currently working on a few projects that may run into issues as their usage scales. During development the sites run without hitch. No time outs - queries seem to run fast; basically no hiccups. However I know that I'm not coding the cleanest and most efficient way possible. Moving forward I would like to make optimization and resource management more of a priority. This post will be a way to track my progress and publish a best practice.

Measuring Memory Usage

memory_get_usage() — Returns the amount of memory allocated to PHP. This number changes depending on the amount of variables being assigned, as well as any files or processing that may be stored in memory.

PHP Page Time Load

Tips

  • Mysql_connections: open and close next to each other
  • Object destruction and Unset to free up variable space

Related Articles

Wordpress 500 Error - missing pages

I just moved the DNS record for a site over that was forwarding to a wordpress installation. ...

John H John H
~1 minute

Fix Sorting in Javascript

Normally sort function compare the ascii values of characters.  This becomes and issue when you...

John H John H
~1 minute

Twitter Timeline Widget Not Showing Up

I had a bug that I ran into today that had me really scratching my head. I needed to place a...

John H John H
3 minutes