hi!
at the moment i try to rewrite my old page with using YII.
this is my old page(sorry can not use links with http becasue i have not enough posts) :
ratmbootlegs.bplaced.net/?mid=4
everything is written with hand, no framework used. it is really fast.
now i created a similiar page with YII:
ratmbootlegs.bplaced.net/yiitest/demos/test/
the YII page is really slow (generation time can be see on the bottom of the pages). I don’t know if i did something wrong or if YII is little bit slow with all the framework overhead?
here is my YII code:
Controller:
$criteria = new CDbCriteria;
$criteria->with = array(
'rectype',
'concert',
'concert.artist',
'concert.country',
'concert.city',
'concert.venue',
'video' => array('joinType' => 'INNER JOIN'),
'video.videoformat',
'medium',
'source'
);
$dataProvider = new CActiveDataProvider('Record',
array(
'criteria' => $criteria,
'pagination' => array(
'pageSize' => 1000,
),
'sort' => $sort,
)
);
$this->render('index', array(
'dataProvider' => $dataProvider,
));
View:
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=>array(
array(
'name'=>'artist',
'value'=>'stripslashes($data->concert->artist->name)',
),
'concert.date',
array(
'name'=>'country',
'value'=>'(( $data->concert->country == NULL ) ? "" : stripslashes($data->concert->country->name))',
),
array(
'name'=>'city',
'value'=>'(( $data->concert->city == NULL ) ? "" : stripslashes($data->concert->city->name))',
),
array(
'name'=>'venue',
'value'=>'(( $data->concert->venue == NULL ) ? "" : stripslashes($data->concert->venue->name))',
),
array(
'name'=>'length',
'value'=>'( $data->sumlength == NULL ) ? "" : $data->sumlength." min"',
),
array(
'name'=>'quality',
'value'=>'$data->quality==NULL ? "" : $data->quality."/10"',
),
array(
'name'=>'type',
'value'=>'(($data->rectype == NULL ) ? "" : stripslashes($data->rectype->shortname))',
),
array(
'name'=>'medium',
'value'=>'(($data->video->videoformat == NULL ) ? "" : $data->video->videoformat->label)." ".(($data->medium == NULL ) ? "" : $data->medium->label)',
),
array(
'name'=>'source',
'value'=>'( $data->source == NULL ) ? "" : $data->source->shortname',
),
array(
'name'=>'version',
'value'=>'($data->sourceidentification)',
),
),
));
?>
is there any way to improve the speed of my YII page? i really like YII with all the features, but if it is really slow like this i can not longer use it.