RE: [PHP-DEV] Re: Calling performance geeks

From: Date: Tue, 14 Mar 2006 06:51:41 +0000
Subject: RE: [PHP-DEV] Re: Calling performance geeks
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
In case if this routine is really called  to frequency, we can use readable
macros for this optimization.

Thanks. Dmitry.

> -----Original Message-----
> From: Andi Gutmans [mailto:[email protected]] 
> Sent: Tuesday, March 14, 2006 8:57 AM
> To: Marcus Boerger; Ron Korving
> Cc: [email protected]
> Subject: Re: [PHP-DEV] Re: Calling performance geeks
> 
> 
> This one isn't a good idea. I bet it won't affect overal performance 
> but makes the code much less maintainable.
> The others look OK (just took a quick glance)
> 
> At 01:20 PM 3/13/2006, Marcus Boerger wrote:
> > > -----
> >
> > > In sapi/apache/mod_php5.c in the function 
> > > php_apache_flag_handler_ex(),
> >
> > > the original:
> > >   if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && 
> arg2[1] == '\0')) {
> > >     bool_val[0] = '1';
> > >   } else {
> > >     bool_val[0] = '0';
> > >   }
> >
> > > is over 5 times slower than:
> >
> > >   if (((arg2[0] == 'O' || arg2[0] == 'o') && (arg2[1] ==
> > > 'n' || 
> > > arg2[1] ==
> > > 'N') && (arg2[2] == '\0')) || (arg2[0] == '1'
> > > && arg2[1] 
> == '\0')) {
> > >     bool_val[0] = '1';
> > >   } else {
> > >     bool_val[0] = '0';
> > >   }
> >
> > > -----
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


Thread (34 messages)

« previous php.internals (#22391) next »