ID: 50571 Comment by: millennium at qme dot nl Reported By: millennium at qme dot nl Status: Feedback Bug Type: MySQLi related Operating System: Windows Server 2003 PHP Version: 5.3.1 New Comment:
C:\php2>php sync.php time: 28.37 secs, memory usage 0.40 MiB. C:\php2>php -v PHP 5.3.2-dev (cli) (built: Dec 22 2009 09:57:39) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies Previous Comments: ------------------------------------------------------------------------ [2009-12-24 23:19:05] j...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2009-12-24 23:01:39] millennium at qme dot nl Description: ------------ The performance of Mysqli in php5.3.1(mysqlnd) is signific slower than the performance in php 5.2.6. (I know it's not the best code, but it's in production, and I would expect 5.3.1 is as fast as 5.2.6 or faster. Reproduce code: --------------- <?php $SERVER = "127.0.0.1"; $USERNAME = ""; $PASSWORD = ""; $DATABASENAME = ""; $high = 2000; $start = microtime(TRUE); for($i = 0; $i <$high; $i++) { $mysql = mysqli_connect($SERVER,$USERNAME,$PASSWORD,$DATABASENAME); mysqli_query($mysql, "UPDATE test SET title = '" . mysqli_real_escape_string($mysql,"test") . "' WHERE test_id = " . null); mysqli_close($mysql); } printf("time: %s secs, memory usage %s MiB.\n", number_format(microtime(TRUE) - $start, 2), number_format(memory_get_usage() / 1024 / 1024, 2)); ?> Expected result: ---------------- time: 1.83 secs, memory usage 0.15 MiB. (php 5.2.6) Actual result: -------------- time: 29.82 secs, memory usage 0.40 MiB ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50571&edit=1