Subject
Author Giacomo Quinti
hi,

my name is Giacomo and subscribing the group I have a question for all of you (with a special thank's for every possibile answers...)...

I'm working on a project based on two dbms (mysql and firebird) and this is my development platform:
ubunbtu 16.04 on a vbox with 1 processor and 2 gb ram, apache + php7 with pdo interbase + firebird 3 manually installed and configured as superserver + mysql.

all is working but I found an important difference between the fast mysql connection with pdo and the slow (in compare) pdo connection with firebird.

To have a simple evidence of this problem I wrote this code

<?php
$start = microtime(true);
$test_connection = new PDO('firebird:dbname=localhost:' . realpath('example.fdb'), 'SYSDBA', 'mypw');
$test_connection = Null;
$time_elapsed_secs_1 = microtime(true) - $start;

$start = microtime(true);
$test_connection = new PDO('mysql:host=localhost;dbname=example', 'root', 'mypw');
$test_connection = Null;

$time_elapsed_secs_2 = microtime(true) - $start;

echo '<br>Time for FB: ' . round($time_elapsed_secs_1, 4);
echo '<br>Time for MY: ' . round($time_elapsed_secs_2, 4);
?>

and this is the output (similar if I run more times but the difference is clear):

Time for FB: 0.0356
Time for MY: 0.0004

connecting mysql is 89 times more faster!

when I run a query there is always a difference but I found very "important" for my project the gap in the connection moment... (I have a lot of simple query but not connecting on the same database, so with different connection to be opened)


so, the question is:

is the pdo driver for firebird so slower than the pdo driver for mysql? is it in a development upgrade? some one can test this problem in other installation to compare the two different pdo drivers?


trying to solve this problem I tried (with the same results):
* firebird 2.5 instead 3.0
* connection with absolute path in firebird and not with localhost... (local vs network connection)
* all the tree types of engine (classic, classic superserver, superserver)
* ... various...


thank's for any help...

Giacomo