[Asterisk-Dev] Proposed patch.

Steve Kann stevek at stevek.com
Fri Apr 29 15:32:07 MST 2005


Brian West wrote:

> If you swap the order.. check for the IDIOT env first.. before the 
> strcmp.. oh well I give up.


Change the idiot env to be _I_AM_NOT_AN_IDIOT_, and then it will be 
faster, since most env variables don't begin with _, and the strcmps (in 
getenv) will return after looking at one char for each variable.

>
> /b
>
> On Apr 29, 2005, at 3:09 PM, Kevin P. Fleming wrote:
>
>> Brian West wrote:
>>
>>
>>> Are you be sarcastic or truthful? haha Because we do this in frame.c 
>>> already. Plus its a one time hit on load/reload.
>>>
>>
>> A one time hit? You are calling getenv() every time you see that 
>> pattern during a configuration load. In frame.c, it happens only if 
>> the user types that special command.
>>
>> Granted, it's not going to affect call handling performance, but it 
>> would still be better to just check it once during the load (since it 
>> can't change while Asterisk is still running) and then reference an 
>> int variable with the value set appropriately.
>> _______________________________________________
>> Asterisk-Dev mailing list
>> Asterisk-Dev at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list