diff options
author | dgp <dgp@noemail.net> | 2014-08-21 23:07:34 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2014-08-21 23:07:34 (GMT) |
commit | b4a0257ed31d63ece637c84e20006df85c70cb73 (patch) | |
tree | 63acdbd3c99b28e286b58dbf1ae80cd75cb49d8d /generic | |
parent | 04f2990ccc01da9010bc9b8de9a1a71506508a35 (diff) | |
download | tcl-b4a0257ed31d63ece637c84e20006df85c70cb73.zip tcl-b4a0257ed31d63ece637c84e20006df85c70cb73.tar.gz tcl-b4a0257ed31d63ece637c84e20006df85c70cb73.tar.bz2 |
Test fix for likely cause of reported I/O slowdown.
In a DoRead() revision, it came to favor making every effort to fill
buffers, in preference to a more sensible goal of favoring avoiding calls
out to the driver if there's already enough data in the buffers to satisfy
the read operation. Result is many more calls out to recv() than are
a good idea. Ought to show up most glaringly when many Tcl_Read() calls
asking for small numbers of bytes (compared to buffer size) each, and that
matches the reported case.
FossilOrigin-Name: 85cd086fd277438a7242118c851cb5ae7cb289f3
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 4452ae9..4f81770 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -8855,6 +8855,7 @@ DoRead( /* If there is no full buffer, attempt to create and/or fill one. */ +if (bufPtr == NULL || BytesLeft(bufPtr) < bytesToRead) { while (!IsBufferFull(bufPtr)) { int code; @@ -8880,6 +8881,7 @@ DoRead( } assert (bufPtr != NULL); +} bytesRead = BytesLeft(bufPtr); bytesWritten = bytesToRead; |