Re: prompt_hook

will guaraldi <[email protected]>
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
Nope--haven't profiled it which is why I haven't qualified how much of a
performance hit it is.  I'm just removing things that probably weren't
architected well and didn't meet the needs I originally intended them for.

Also, I'm not entirely sure how to go about re-implementing it using the
telnetlib.  So one possibility is that I could check in the changes I've
made and we can work through re-implementing the pieces as we figure out
how to re-implement them.  I don't use prompt detection, so it's not
something that I can test easily.

/will


On Tue, 20 Apr 2004, Eugene wrote:

> On Tue, 20 Apr 2004 08:22:25 -0500 (CDT) will guaraldi
> <[email protected]> wrote:
> >
> >Here's why I'm asking: I just reimplemented the net module to use the
> >telnetlib (which is broken in regards to telnet options in previous
> >versions of Python [though I can't remember which ones--I think 2.2 but
> >it might have been 2.1--I keep meaning to look this up]) and in doing
> >so dumped all our prompt detection stuff.
> >
> >I was originally thinking it'd be useful for things like mappers and
> >anything else that really needs to link user commands with mud
> >responses. Josh implemented his commandresponse module at a higher
> >level and it seems to work a lot better.  I was never able to get my
> >commandresponse module (which worked with the prompt detection) to
> >work.
> >
> >So, given that I couldn't use it for what I was hoping to use it for,
> >I'm thinking it slows things down (running a regexp on all incoming
> >data...)
>
> It is another issue. I said I don't use the hook itself, but I'd like
> the detection stuff (including the regexp) to remain. I anyway detect a
> prompts by checking the incoming line with line.endswith("\n"), so I
> think it is convenient to have a prompt going through filters as
> separate line.  (I rely on prompts-as-separate-lines in another my
> modules too.)
>
> Generally, I think prompts should be considered as separate lines
> themselves, not as nondelimited part of some another line which is have
> to come later. And it cannot be done without the regexp checking.
>
> By the way, I don't think the regexp checking eats that many of CPU; did
> you perform a profiling? The regexp are usually pretty fast.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.