04 Feb
by: Matt in Development
tags: optimizing, php, profiling, sql
Spending most of the day optimizing a page that (when I began) took 8.6 seconds to execute. Using some basic profiling techniques helped tremendously in not wasting my time and efforts attempting to optimize a portion of code that won’t yield appreciable gains.
The time intensive code for applications I write generally fall into either [...]
04 Feb
by: Matt in Development, PHP
tags: execution time, microtime, php, profiling
Had to quickly get the execution time of certain segments of code so I whipped up this basic profiling class below.
Usage would go something like:
<?php
$profiler = new cProfiler;
$profiler->start();
// … long block of code …
$et = $profiler->end();
echo ‘longBlock et = ‘.$et.’<br>’;
?>
Class listing cProfiler.php:
<?php
class cProfiler
{
public $_i;
public $stamps;
public $ets;
function __construct()
{
$this->_i = 0;
$this->stamps = array();
$this->ets = array();
}
function __destruct() {}
function [...]
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.