#define INI_IS_TRUE(str) \
        (((str)[0] == 'O' || ((str)[0] == 'o') && \
          (str)[1] == 'N' || ((str)[1] == 'n') && \
          (ste)[2] == 0)) || \
         (str[0] == '1' && str[1] == 0))

But it make sense only if it really gives speedup.

Dmitry.

> -----Original Message-----
> From: Ron Korving [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 14, 2006 10:37 AM
> To: internals@lists.php.net
> Subject: Re: [PHP-DEV] Re: Calling performance geeks
> 
> 
> If this is possible, like Dmitry said, with a macro, that would be 
> interesting. I'm curious what this macro would look like. 
> Personally, I tend 
> to go for the less readable solution if the performance advantage is 
> definately there. A little comment to the code should always 
> be able to 
> clearify it for any reader. But of course, in this case, it 
> is all entirely 
> up to you guys.
> 
> Regards,
> 
> Ron
> 
> 
> "Andi Gutmans" <[EMAIL PROTECTED]> schreef in bericht 
> news:[EMAIL PROTECTED]
> >I don't think it gets called enough to be substantial and 
> worth making 
> >this
> >harder to maintain (unless I'm proven wrong :)
> >
> > Andi
> >
> > At 10:51 PM 3/13/2006, Dmitry Stogov wrote:
> >>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: internals@lists.php.net
> >> > 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
> >> >
> >> >
> >> > 
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to