Yii Framework Forum: Scripts execution time - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Scripts execution time Rate Topic: -----

#1 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 18 July 2010 - 03:25 PM

Hi guys!

I decide to test my scripts and to see how much time it requires for execute.

In config:
'components'=>array(
	'log'=>array(
		'class'=>'CLogRouter',
		'routes'=>array(
			array(
				'class'=>'CProfileLogRoute',
			),


Then in main index.php:
<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);

Yii::beginProfile('blockID');

Yii::createWebApplication($config)->run();

Yii::endProfile('blockID');


And that what I saw. As you can see all queries executes fairly fast. But I'm interesting in first line: "blockID ... 0.1385s". I can't understand what is it means. Is it the time for executing the beginProfile('blockID') command itself ?
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 19 July 2010 - 02:09 AM

That's the time that is spent between the beginProfile and endProfile calls. So in your case: The complete time required for Yii::createWebApplication($config)->run();.
0

#3 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 19 July 2010 - 03:30 AM

Is it the long time and need to optimize?
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 19 July 2010 - 04:34 AM

This value alone is of not much use. You should better use e.g. ab (Apache Benchmark tool) to test the requests per seconds and compare that to load you expect. Profiling is rather to find out bottlenecks of your application (like: Where is most time spent?)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users