[Asterisk-Dev] FW: asterisk/doc CODING-GUIDELINES,1.4,1.5

Preston Garrison preston at mailblocks.com
Wed Jan 19 10:04:24 MST 2005


You know if you are so worried about string optimizations the smart 
thing to do would be using a smart-strings library like i have been 
doing for years.  Basically an expanding string that stores information 
about the size, length, etc string along with the string.  So any 
checks for size, only are a matter of checking a memory location.  
Although I hardly thing the gain you  get from string checking is worth 
all this effort :)  In reality alto more stuff should be converted from 
using strings alltogether.  Asterisk does a shitload of stuff with  
passing of strings.

Preston Garrison
direct: 877-748-4142
fax: 310-774-3901
cell: 623-748-4140

-----Original Message-----
From: Kevin P. Fleming <kpfleming at starnetworks.us>
To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
Sent: Wed, 19 Jan 2005 07:32:06 -0700
Subject: Re: [Asterisk-Dev] FW: asterisk/doc CODING-GUIDELINES,1.4,1.5

Andrew Kohlsmith wrote:

  > Personally I feel this whole ast_strlen_zero macro (it better be a 
macro or at > least inline function!) is poor optimization -- does 
Asterisk really spend so > much time in strlen() that it was necessary?

  It is a static inline function, essentially the same as a macro. Do a 
grep over the sources to see how often it is called... there are many, 
many calls.

  I have some new stuff coming in a few weeks that will drastically 
reduce all this length-checking and string-copying (along with massive 
memory usage decrease)... stay tuned, and be ready to provide testing 
boxes when the patch is available in Mantis :-)
 _______________________________________________
 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