While rendering the view in Yii2, I noticed the render time is a bit too long. And here is a part of log:
03:57:57.435 info yii\db\Command::query SELECT * FROM
user_profileWHEREuseridIN (16, 15, 12)03:57:57.501 trace yii\base\View::renderFile
please notice the time between in the two steps, almost takes more than 80ms. The render view is simple, just a gridview widget with my own code. The less page size is, the less render time it costs. When the column is about 15 items it almost takes 250ms to render the view. Besides, the sql queries takes 2ms in total.
'columns' => [
[
'header' => 'Article title',
'attribute' => 'article_title',
'format' => 'html',
'value' => function ($dataProvider) {
/**
* bunch of code
*/
return $info;
},
],
],
So is that the code file causes this? Should I rebuild my code?
AppAssetsbundle for you application. - Muhammad Omer Aslam