[Linpha-cvs] SF.net SVN: linpha: [4873] trunk
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2008-02-13 18:42:23
|
Revision: 4873 http://linpha.svn.sourceforge.net/linpha/?rev=4873&view=rev Author: fangehrn Date: 2008-02-13 10:42:19 -0800 (Wed, 13 Feb 2008) Log Message: ----------- Added Paths: ----------- trunk/misc/benchmark/benchmark.php Removed Paths: ------------- trunk/linpha2/lib/modules/module.benchmark.php Deleted: trunk/linpha2/lib/modules/module.benchmark.php =================================================================== --- trunk/linpha2/lib/modules/module.benchmark.php 2008-02-13 18:37:37 UTC (rev 4872) +++ trunk/linpha2/lib/modules/module.benchmark.php 2008-02-13 18:42:19 UTC (rev 4873) @@ -1,118 +0,0 @@ -<?php - -function callbackBenchmark() -{ - benchmarkConfigTable(); - - echo '<br /><br />'; - - echo microtime(true)-$GLOBALS['linStartTime'].'<br />'; -} - - -function benchmarkConfigTable() -{ - $startTime = microtime(true); - - - $query = $GLOBALS['linpha']->db->Execute("SELECT option_name, option_value " . - "FROM ".LIN_PREFIX."config WHERE user_id = '0'"); - while($data = $query->FetchRow()) - { - $config[$data['option_name']] = $data['option_value']; - } - - $dbversion = $config['sys_db_version']; - $events = $config['plugins_log_email_add_events']; - //$nrprevnext = $config['sys_style_image_nrprevnextthumbs]']; - //$nrrows = $config['sys_style_thumb_nojsnrrows']; - //$nrcols = $config['sys_style_thumb_nojsnrcols']; - - $endTime = microtime(true); - echo ($endTime - $startTime).'<br />'; - - - $startTime = adodb_microtime(); - - $dbversion = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_db_version'"); - $events = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'plugins_log_email_add_events'"); - //$nrprevnext = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_image_nrprevnextthumbs'"); - //$nrrows = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_thumb_nojsnrrows'"); - //$nrcols = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_thumb_nojsnrcols'"); - - $endTime = microtime(true); - echo ($endTime - $startTime).'<br />'; - - /** - * 1 config element: - run 1 - 0.00226402282715 - 0.00149202346802 - - run 2 - 0.00227904319763 - 0.00114703178406 - - run 3 - 0.00260281562805 - 0.00146698951721 - - run 4 - 0.00237584114075 - 0.00184106826782 - - * 2 config elements - run 1 - 0.00249886512756 - 0.00247406959534 - - run 2 - 0.00243592262268 - 0.00234603881836 - - run 3 - 0.00245499610901 - 0.00245714187622 - - run 4 - 0.00249600410461 - 0.00249814987183 - - * 5 config elements: - run 1 - 0.00249576568604 - 0.00594997406006 - - run 2 - 0.00240993499756 - 0.00583410263062 - - run 3 - 0.00282597541809 - 0.00611996650696 - - run 4 - 0.00280523300171 - 0.00573897361755 - - - - -> yes it is good to have an array with the saved config entries - */ -} - -function benchmarkGetAssoc() -{ - // $db->GetAssoc - // array_merge - // copy by reference -} - - -$linpha->template->output['default'] = ''; -$linpha->template->fnCallback = 'callbackBenchmark'; -$linpha->template->setModuleName('default'); -$linpha->template->URL_full = LINPHA_LINK.'&linCat=empty'; -$linpha->template->output['title'] = i18n("empty"); -include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); -?> \ No newline at end of file Copied: trunk/misc/benchmark/benchmark.php (from rev 4872, trunk/linpha2/lib/modules/module.benchmark.php) =================================================================== --- trunk/misc/benchmark/benchmark.php (rev 0) +++ trunk/misc/benchmark/benchmark.php 2008-02-13 18:42:19 UTC (rev 4873) @@ -0,0 +1,118 @@ +<?php + +function callbackBenchmark() +{ + benchmarkConfigTable(); + + echo '<br /><br />'; + + echo microtime(true)-$GLOBALS['linStartTime'].'<br />'; +} + + +function benchmarkConfigTable() +{ + $startTime = microtime(true); + + + $query = $GLOBALS['linpha']->db->Execute("SELECT option_name, option_value " . + "FROM ".LIN_PREFIX."config WHERE user_id = '0'"); + while($data = $query->FetchRow()) + { + $config[$data['option_name']] = $data['option_value']; + } + + $dbversion = $config['sys_db_version']; + $events = $config['plugins_log_email_add_events']; + //$nrprevnext = $config['sys_style_image_nrprevnextthumbs]']; + //$nrrows = $config['sys_style_thumb_nojsnrrows']; + //$nrcols = $config['sys_style_thumb_nojsnrcols']; + + $endTime = microtime(true); + echo ($endTime - $startTime).'<br />'; + + + $startTime = adodb_microtime(); + + $dbversion = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_db_version'"); + $events = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'plugins_log_email_add_events'"); + //$nrprevnext = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_image_nrprevnextthumbs'"); + //$nrrows = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_thumb_nojsnrrows'"); + //$nrcols = $GLOBALS['linpha']->db->GetOne("SELECT option_value FROM ".LIN_PREFIX."config WHERE user_id = '0' AND option_name = 'sys_style_thumb_nojsnrcols'"); + + $endTime = microtime(true); + echo ($endTime - $startTime).'<br />'; + + /** + * 1 config element: + run 1 + 0.00226402282715 + 0.00149202346802 + + run 2 + 0.00227904319763 + 0.00114703178406 + + run 3 + 0.00260281562805 + 0.00146698951721 + + run 4 + 0.00237584114075 + 0.00184106826782 + + * 2 config elements + run 1 + 0.00249886512756 + 0.00247406959534 + + run 2 + 0.00243592262268 + 0.00234603881836 + + run 3 + 0.00245499610901 + 0.00245714187622 + + run 4 + 0.00249600410461 + 0.00249814987183 + + * 5 config elements: + run 1 + 0.00249576568604 + 0.00594997406006 + + run 2 + 0.00240993499756 + 0.00583410263062 + + run 3 + 0.00282597541809 + 0.00611996650696 + + run 4 + 0.00280523300171 + 0.00573897361755 + + + + -> yes it is good to have an array with the saved config entries + */ +} + +function benchmarkGetAssoc() +{ + // $db->GetAssoc + // array_merge + // copy by reference +} + + +$linpha->template->output['default'] = ''; +$linpha->template->fnCallback = 'callbackBenchmark'; +$linpha->template->setModuleName('default'); +$linpha->template->URL_full = LINPHA_LINK.'&linCat=empty'; +$linpha->template->output['title'] = i18n("empty"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |