On Mon, Apr 26, 2010 at 6:10 PM, Peter Samuelson <peter_at_p12n.org> wrote:
> [Philip Martin]
> > We have svn_ctype_isalpha which is a macro that does a table lookup.
> > We don't currently have svn_ctype_isxdigit but it could be added.
> > > I'd rather see the whole thing become a single table lookup. Untested
> > > patch appended.
> > Is this a bottleneck? I think using the svn_ctype.h macros should be
> > sufficient.
> I don't know if it's a bottleneck. But given that what we actually
> want to know if 'what is the value of this hex digit' - using isxdigit,
> then isalpha as a conditional, then ASCII arithmetic is awfully
> roundabout compared to just a single table lookup.
> I mean, the whole point of those ctype functions is to avoid ASCII
> arithmetic. So, while I don't claim my patch will be noticeably faster
> (it will be faster but probably not noticeably so), I do claim it's
> more elegant.
I would agree. I saw the commit of Stefan's patch, and independently
thought about using a lookup table (though I prefer Peter's implementation).
I don't have any hard performance numbers, but I gotta believe the lookup
table is simpler, as well as more performant.
Received on 2010-05-05 16:55:42 CEST