Good day!
I test phalcon in my project. I thought, it's very faster then others. But...
Look at my test
$app = new Micro($di);
$app->get('/', function () use ($app) {
$users = $app->modelsManager->executeQuery("SELECT * FROM TEST WHERE NAME IN ('L488', '1K5T', '4QYS' , '9ECV')");
$data = array();
foreach ($users as $user) {
$data[] = array(
'name' => $user
);
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
});
And my model
use Phalcon\Mvc\Model;
class TEST extends Model {
public $name;
public function initialize() {
$this->setSource("TEST");
}
}
The query execution time is 1.2-1.5 s. Now without phalcon
$user = 'name';
$pass = 'pass';
$dbh = new PDO('oci:dbname=orcl', $user, $pass);
$users = $dbh->query("SELECT * FROM TEST WHERE NAME IN ('L488', '1K5T', '4QYS' , '9ECV')");
$data = array();
foreach ($users as $user) {
$data[] = array(
'name' => $user
);
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
The query execution time is 600-700 ms WTF? How it can be? Why phalcon modelsManager slower