[DGD] Reasonable Tick Counts?

Petter Nyström jimorie at gmail.com
Sun Jul 8 00:17:56 CEST 2007


For some of my simpler parser work that reminds me a lot of what Kurt
speaks of, I have found sscanf() and a loop to be the fastest. (In
real time, not sure about ticks-wise.) parse_string() has been of
roughly the same speed, however, but in my opinion more of a hassle to
implement in those cases.

Regards,

Jimorie

On 7/7/07, Noah Gibbs <noah_gibbs at yahoo.com> wrote:
>   You'll find that parse_string() has high overhead if you only do it once (the
> overhead is mostly from compiling the grammar), but that it perks up when you
> use the same grammar multiple times.  So if you're only planning to do ASCII
> substitution once per run of your MUD, don't use it :-)
>
> --- Kurt Nordstrom <kurt at blar.net> wrote:
>
> > Okay, well, I found a way to implement it with explode() and implode()
> > that seems to work.  Don't know why I didn't do it that way in the first
> > place.  Are you sure a parse_string() solution would be the most
> > efficient?  Seems to have a good chunk of overhead there.
> >
> > And yeah, it was character-by-character before.  Some things I seem to
> > be determined to learn the hard way.
> >
> > -Kurt
> >
> > Noah Gibbs wrote:
> > >   Oh -- I should probably also say that there are much better and much
> > worse
> > > ways to code this kind of thing in DGD.  For instance, are you using
> > > parse_string() to parse the escape sequences?  It's almost certainly the
> > best
> > > way to do it, and a character-by-character parser could conceivably be
> > > inefficient enough to require 10k ticks on fairly modest inputs.
> > >
> >
> > ___________________________________________
> > https://mail.dworkin.nl/mailman/listinfo/dgd
> >
>
>
>
>
>
>
> ____________________________________________________________________________________
> Got a little couch potato?
> Check out fun summer activities for kids.
> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list