![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Socket slowdown when using two separate print statementsby suaveant (Parson) |
on May 06, 2011 at 16:02 UTC ( #903408=perlquestion: print w/replies, xml ) | Need Help?? |
suaveant has asked for the wisdom of the Perl Monks concerning the following question:
I've either found a bug, a quirk, or I'm stupid, but I've been banging my head against this issue for two days now, and I finally at least isolated the cause.
I have a server that allows you to connect and make multiple queries on a single socket connection the main loop decides which function to call, the function prints data to the sock and once we return the main loop basically does print {$client} "__END__\n"; Apparently this is bad, and I've created a simple echoing client server pair which illustrate... When this runs all is great! But if you change that print to the socket to be: Then sadness and woe befall the code! ARGH! The first call is fast, and every subsequent one has about .4s tacked on for fun, multiply that by 5000 and it starts to really add up. What am I missing here?
Back to
Seekers of Perl Wisdom
|
|