Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Apr 2005 20:46:50 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        Jeremie Le Hen <jeremie@le-hen.org>
Subject:   Re: strcspn(3) complexity improvement
Message-ID:  <200504060346.j363ko4b088610@apollo.backplane.com>
References:  <20050330083435.GI75546@obiwan.tataz.chchile.org> <20050330183145.GB24465@odin.ac.hmc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
:The real question I have is, how long does the string need to be before
:this is a win and how much does it hurt for typical string lengths?
:I've written code with strcspn that needed to perform well, but it was
:parsing 80-column punch card derived formats.
:
:-- Brooks

     I think the answer is to not use strcspn() in cases where it *really*
     matters.

     I don't think what's in DFly is the right solution either.  A bitmap
     would be a good compromise, though... that would only require clearing
     32 bytes (vs 256) at the cost of slowing down the loop a little.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504060346.j363ko4b088610>