develooper Front page | perl.perl5.porters | Postings from November 1999

Re: Patch for Threading and Regexps

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
November 19, 1999 13:14
Subject:
Re: Patch for Threading and Regexps
Message ID:
19991119161442.A22205@monk.mps.ohio-state.edu
On Fri, Nov 19, 1999 at 04:10:17PM -0500, Mark-Jason Dominus wrote:
> 
> > > -	    (s = rx->startp[paren]) != -1 &&
> > > -	    (t = rx->endp[paren]) != -1)
> > > +	    (s = get_match_node(rx)->startp[paren]) != -1 &&
> > > +	    (t = get_match_node(rx)->endp[paren]) != -1)
> > 
> > Nope.  You do not want to make function calls in this tight code.
> 
> It is not a function call.  It is a compile-time macro:
> 
> > > +#ifdef USE_THREADS
> > > +#  define get_match_node(regexp) (&(PL_matchvars[regexp->regexp_index]))
> > > +#else
> > > +#  define get_match_node(regexp) (regexp)
> > > +#endif

This is even much worse.  How regexp_index is assigned?  Is it just
incrementing?  And still it is many more dereferences than what is needed.

Ilya

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About