Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Socket Server Speed

by amphiplex (Monk)
on Jul 01, 2002 at 13:52 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2022-09-27 20:20 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (124 votes). Check out past polls.