Skip to content

Commit c71d64c

Browse files
committed
Set chunk size to 64 KB
Still, this is an arbitrary choice. But as send_long_data() is designed to send out data to the network immediately, it is probably a good thing performance-wise to have a little bit bigger chunks (think TCP windows or offloading). And, on the other hand, 64 KB of memory in PHP should not hurt that much.
1 parent 0cd703f commit c71d64c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private function _processLongData()
257257
if (is_resource($value) && get_resource_type($value) === 'stream') {
258258
$stream = $value;
259259
while (! feof($stream)) {
260-
$chunk = fread($stream, 8192);
260+
$chunk = fread($stream, 64 * 1024);
261261
if ($chunk === false) {
262262
throw new MysqliException("Failed processing the stream resource for parameter offset ${paramNr}.");
263263
}

0 commit comments

Comments
 (0)