Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Small socket read/write optimization

Closed / Wont Fix926312ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2004-03-30 22:25:13
Perform test for TCP_ASYNC_CONNECT before calling
WaitForConnect.
Only call WaitForConnect if necessary.
Remove variable 'state'.
A small optimization which removes a function call
overhead for read/write operations on sockets (once the
socket is connected). Also uses one less variable -
this variable wan't really needed in the first place. 
It should be faster, but a quick
measurement shows no noticeable improvement.
stwoplain2004-03-31 05:25:13
File Added - 81999: patch-unix_tclUnixChan_c
andreas_kupriesplain2004-07-17 01:40:20
Logged In: YES 
user_id=75003

I would not try to outguess the compiler and opt for clean
implementation, .i.e. as the code currently is.

As proposed it becomes more diffiicult to maintain as
changes in the function may have to be reflected to the
call-sites as well for the code to stay correct. The patch
does not mention that stuff from within WaitForConnect is
now duplicated at the places calling WFC.
Log in (anonymous is fine) to add a comment.

Attachments: