|
From: Braden M. <br...@en...> - 2002-01-21 08:27:26
|
On Fri, 2001-12-28 at 06:50, Damian McGuckin wrote:
>
> In our quest for speed, we inline'd _GetNextChar() and it turns out that
> on a 1000Mhz Pentium, isNewLineChar() is chewing up 10% of the time on
> nextToken().
>
> I was thinking of inlining all the routines in the anonymous namespace.
Where inlining is showing a tangible performance increase, I certainly
think we should do it.
> Some questions:
>
> a) Could we come up some 'ctype' like scheme whereby we assume
> that char is signed and we do a table lookup?
I imagine so.
> b) Alternatively, is a test such as
>
> (isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'))
>
> always valid for a hex digit.
Looks good to me.
> While I fully appreciate that one should get it right before you make it
> fast, we find that if something takes ages to load, be it a VRML file or
> a web page, then users will complain.
I'd like at some point to rewrite our parser to use Spirit instead of
ANTLR. I don't know if that'll end up giving us a speed boost, but I'd
be surprised if it hurt us. (My primary motivation is that I think
Spirit would be a less annoying dependency.) Spirit's still evolving
kinda rapidly, and the ANTLR parser works, so I'm not in a rush to get
this done.
It looks like you're focusing on the scanner here for performance
improvements; and I think any improvements there should help us
regardless of whether we're using ANTLR or Spirit.
--
Braden McDaniel e-mail: <br...@en...>
<http://endoframe.com> Jabber: <br...@ja...>
|