$result = mysql_query($sql, $link); // if (!$result) { // echo "Erreur DB, impossible d'effectuer une requête\n"; // echo 'Erreur MySQL : ' . mysql_error(); // echo $sql . "\n"; // // echo $i; // // exit; // } } return true; } $sql = "select * from orderdetails"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'SELECT *'); $sql = "select count(*) from orderdetails"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'COUNT *'); $sql = "select * from orderdetails where orderNumber = 10101"; $memory = memory_get_usage($real); $benchmark->start($memory); $result = geResult($sql, $link); $pick = memory_get_peak_usage($real); $benchmark->stop($pick, 'By orderNumber');
/** * @param int * @param string * @param string * @return void */ function http_error($status, $title, $html) { require_once MVC_DIR . 'event.d/http_error.php'; } ######################################################################## # init dev stuff - we keep it here instead of event.d because the dev performance is important. if (MVC_DEV_MODE) { $benchmarkTimer = new BenchmarkTimer(); BenchmarkTimer::$utf8 = 0; $benchmarkTimer->start(); $_mvc_dev_can_print = null; /** * @return bool * @ignore */ function mvc_dev_can_print() { global $_mvc_dev_can_print; if ($_mvc_dev_can_print !== null) { return $_mvc_dev_can_print; } foreach (headers_list() as $h) { if (strcasecmp(substr($h, 0, 12), 'content-type') == 0) { if (stripos($h, 'text/html') === false) { return $_mvc_dev_can_print = false;