develooper Front page | perl.perl5.porters | Postings from March 2010

Re: Another optimization question: bsearch()

Thread Previous | Thread Next
Andy Dougherty
March 1, 2010 14:40
Re: Another optimization question: bsearch()
Message ID:
On Mon, 1 Mar 2010, H.Merijn Brand wrote:

> On Mon, 01 Mar 2010 11:43:27 -0700, karl williamson
> <> wrote:
> > Jarkko a long time ago that swashes and regex character classes should 
> > be replaced by inversion lists for efficiency.
> > 
> > Inversion lists can be searched binarily.  bsearch() is a standard C 
> > library routine, but the only mention of it in Perl is in the POSIX 
> > module where it says it is not furnished.  This makes me think there 
> > must be a problem with using the library routine.  Is there?
> Seems to be available on both my oldest HP-UX as well as on my oldest
> AIX. Do you need a probe for it in Configure?

It's in my old SVR3 manuals too, though with a simpler prototype (char 
instead of void, and no const).  The "unimplemented" message has been 
there since perl 5.000.  I don't remember any specific problem with the 
function. I suspect it's unimplemented in simply because it's 
never been a high enough priority for anyone to actually figure out how 
they'd like to map it into perl.

In short, if it makes sense to use it, I think you can go ahead and use 

    Andy Dougherty

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About