Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Socket Server Speed

by amphiplex (Monk)
on Jul 01, 2002 at 13:52 UTC ( [id://178553]=note: print w/replies, xml ) Need Help??


in reply to Socket Server Speed

Hi ! There are some things that caught my eye immediately:
  • why do you sleep after each line received ?
  • you use the same substr command 5 times, it would be much more efficient to store the result of substr into a variable once and then use this variable
  • why do you call autoflush after reading a line ? It is sufficient to call it once, as you do anyhow

---- kurt

Replies are listed 'Best First'.
Re: Re: Socket Server Speed
by wileykt (Acolyte) on Jul 01, 2002 at 14:24 UTC
    Thanks, those changes made it much faster. I'm sure the main offender was the sleep. I hadn't ment to do that, just one of those things that I wasn't paying attention to.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://178553]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found