Tcl Source Code

Check-in [5180649ac5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Same results; simpler logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dgp-slow-read
Files: files | file ages | folders
SHA1: 5180649ac52bc399db10978a7fde7af931fe5fcb
User & Date: dgp 2014-08-22 13:20:21
Context
2014-08-22
13:23
Correct performance regression in a series of short binary reads from a socket. Many thanks to Eric... check-in: 70e97884f0 user: dgp tags: core-8-5-branch
13:20
Same results; simpler logic. Closed-Leaf check-in: 5180649ac5 user: dgp tags: dgp-slow-read
2014-08-21
23:07
Test fix for likely cause of reported I/O slowdown. In a DoRead() revision, it came to favor making ... check-in: 85cd086fd2 user: dgp tags: dgp-slow-read
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIO.c.

8849
8850
8851
8852
8853
8854
8855

8856


8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
	 */

	if (GotFlag(statePtr, CHANNEL_EOF)
		&& (bufPtr == NULL || IsBufferEmpty(bufPtr))) {
	    break;
	}


	/* If there is no full buffer, attempt to create and/or fill one. */



if (bufPtr == NULL || BytesLeft(bufPtr) < bytesToRead) {
	while (!IsBufferFull(bufPtr)) {
	    int code;

	moreData:
	    code = GetInput(chanPtr);
	    bufPtr = statePtr->inQueueHead;

	    assert (bufPtr != NULL);

	    if (GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)) {
		/* Further reads cannot do any more */
		break;
	    }
	    
	    if (code) {
		/* Read error */
		UpdateInterest(chanPtr);
		TclChannelRelease((Tcl_Channel)chanPtr);
		return -1;
	    }

	    assert (IsBufferFull(bufPtr));
	}

	assert (bufPtr != NULL);
}

	bytesRead = BytesLeft(bufPtr);
	bytesWritten = bytesToRead;

	TranslateInputEOL(statePtr, p, RemovePoint(bufPtr),
		&bytesWritten, &bytesRead);
	bufPtr->nextRemoved += bytesRead;
	p += bytesWritten;







>
|
>
>

|
<
<
<

|
<
<
<
<
<
<
<
<
<
<





|
<


<
<
<







8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861



8862
8863










8864
8865
8866
8867
8868
8869

8870
8871



8872
8873
8874
8875
8876
8877
8878
	 */

	if (GotFlag(statePtr, CHANNEL_EOF)
		&& (bufPtr == NULL || IsBufferEmpty(bufPtr))) {
	    break;
	}

	/*
	 * If there is not enough data in the buffers to possibly
	 * complete the read, then go get more.
	 */

	if (bufPtr == NULL || BytesLeft(bufPtr) < bytesToRead) {



	moreData:
	    if (GetInput(chanPtr)) {










		/* Read error */
		UpdateInterest(chanPtr);
		TclChannelRelease((Tcl_Channel)chanPtr);
		return -1;
	    }
	    bufPtr = statePtr->inQueueHead;

	}




	bytesRead = BytesLeft(bufPtr);
	bytesWritten = bytesToRead;

	TranslateInputEOL(statePtr, p, RemovePoint(bufPtr),
		&bytesWritten, &bytesRead);
	bufPtr->nextRemoved += bytesRead;
	p += bytesWritten;