[asterisk-users] Use the NEW ulaw/alaw codecs (slower, but cleaner)

Benny Amorsen benny+usenet at amorsen.dk
Mon Nov 17 15:31:01 CST 2008


Matthew Fredrickson <creslin at digium.com> writes:

> Actually, with the way caching is done on nearly all modern processors, 
> it is debatable whether or not a look up table is the optimal way to do 
> the conversion, at least on such a simple codec such as ulaw or alaw. 
> In fact, the amount of time it takes to fetch memory from a cache miss 
> can easily ruin the single element lookup performance in a look up 
> table.

If the compiler is clever enough, you can embed a small lookup table
in the instruction stream. Instruction prefecting will automatically
ensure the page is in I-cache, and even on most processors which can't
read from I-cache the table will be in 2nd-level cache.

Low-level optimizations like these are often dependent on processor
architecture though.


/Benny




More information about the asterisk-users mailing list