|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-24 23:19 UTC] jani@php.net
[2009-12-24 23:26 UTC] millennium at qme dot nl
[2009-12-25 00:25 UTC] scottmac@php.net
[2009-12-25 00:39 UTC] millennium at qme dot nl
[2009-12-25 00:41 UTC] pajoye@php.net
[2010-01-09 19:19 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 11:00:01 2025 UTC |
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