[Asterisk-Dev] Profiling results: Asterisk processing 5000 concurrent IAX registrations

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Mon Oct 31 08:20:42 MST 2005


On Monday 31 October 2005 09:46, Kevin P. Fleming wrote:
> Yes, using strcmp() makes a noticeable difference. Another (additional)
> technique that I've tried is to use an 'int *' comparison when the
> string-to-be-searched-for is at least 3 characters long, to weed out the
> peers whose names don't have the same first four bytes... this makes a
> large difference as well.

It really sounds like you either want to index or do an insertion sort so you 
can do a straight binary search.

> The most efficient technique, unless you are using a small number of
> extremely short peer names, is to use string hashes and hash table
> lookups. I had much of that working a few months ago (before I came to
> Digium), and I'll be resurrecting that code about five minutes after 1.2
> is released :-)

Yes, that'd work too.  :-)

-A.



More information about the asterisk-dev mailing list