[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: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Wed, 5 May 2010 16:55:10 +0200

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.

-Hyrum
Received on 2010-05-05 16:55:42 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.