Req #63525 [Opn->Fbk]: php5.4.8 connecting to mysql is slower then php5.2.6

From: Date: Thu, 15 Nov 2012 09:37:35 +0000
Subject: Req #63525 [Opn->Fbk]: php5.4.8 connecting to mysql is slower then php5.2.6
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-174706@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63525&edit=1

 ID:                 63525
 Updated by:         andrey@php.net
 Reported by:        admin at wudimei dot com
 Summary:            php5.4.8 connecting to mysql is slower then php5.2.6
-Status:             Open
+Status:             Feedback
 Type:               Feature/Change Request
 Package:            MySQL related
 Operating System:   windows 7
 PHP Version:        5.4.8
 Block user comment: N
 Private report:     N

 New Comment:

Can you try 127.0.0.1 instead of localhost and report the connect time?


Previous Comments:
------------------------------------------------------------------------
[2012-11-15 09:09:19] admin at wudimei dot com

Description:
------------
php5.4.8 connecting to mysql is slower then php5.2.8

i use php5.4.8 to connect the mysql,it's slow!it take about 1.0138568878174 seconds.
then i switch to php5.2.6 ,it only take 0.00234985351562 seconds.

please improve it
thank you!

yang qingrong

Test script:
---------------
<?php
$a = microtime( true );
$conn = mysql_connect("localhost","root","123456");
mysql_select_db("yqr");
$q = mysql_query("show tables");
while( $r = mysql_fetch_assoc( $q ))
{
    print_r( $r );
}
 echo microtime(true ) - $a; echo " seconds"; exit();
?>

php5.4.8 output:

Array ( [Tables_in_yqr] => account_book ) Array ( [Tables_in_yqr] => customer ) Array (
[Tables_in_yqr] => domain ) Array ( [Tables_in_yqr] => friends ) Array ( [Tables_in_yqr] =>
hourly_work ) Array ( [Tables_in_yqr] => hourly_work_project ) Array ( [Tables_in_yqr] =>
notepad ) Array ( [Tables_in_yqr] => notepad_ctg ) Array ( [Tables_in_yqr] => schedule )
1.0138568878174 seconds

php 5.2.6 output
Array ( [Tables_in_yqr] => account_book ) Array ( [Tables_in_yqr] => customer ) Array (
[Tables_in_yqr] => domain ) Array ( [Tables_in_yqr] => friends ) Array ( [Tables_in_yqr] =>
hourly_work ) Array ( [Tables_in_yqr] => hourly_work_project ) Array ( [Tables_in_yqr] =>
notepad ) Array ( [Tables_in_yqr] => notepad_ctg ) Array ( [Tables_in_yqr] => schedule )
0.00234985351562 seconds



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63525&edit=1


Thread (6 messages)

« previous php.bugs (#174706) next »