[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Saving a few cycles, part 2/2

From: Peter Samuelson <peter_at_p12n.org>
Date: Mon, 26 Apr 2010 11:10:02 -0500

[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.

Peter
Received on 2010-04-26 18:10:25 CEST

This is an archived mail posted to the Subversion Dev mailing list.