diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-28 23:13:37 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-28 23:13:37 +0000 |
commit | c561cdc896fa2699987085b9af42346c4689b200 (patch) | |
tree | 9b625d68239c4f9c8cda402316f4dc36f8a59319 /channels | |
parent | a1a8dcf0d4ed2710c6581269c8b4cb762195fcf7 (diff) |
Add a comment to note near some code that performs a very expensive operation
that occurs for every incoming media frame.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48099 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_iax2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index f7cdcb289..78bf747c5 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1195,6 +1195,20 @@ static int make_trunk(unsigned short callno, int locked) return res; } +/*! + * \todo XXX Note that this function contains a very expensive operation that + * happens for *every* incoming media frame. It iterates through every + * possible call number, locking and unlocking each one, to try to match the + * incoming frame to an active call. Call numbers can be up to 2^15, 32768. + * So, for an call with a local call number of 20000, every incoming audio + * frame would require 20000 mutex lock and unlock operations. Ouch. + * + * It's a shame that IAX2 media frames carry the source call number instead of + * the destination call number. If they did, this lookup wouldn't be needed. + * However, it's too late to change that now. Instead, we need to come up with + * a better way of indexing active calls so that these frequent lookups are not + * so expensive. + */ static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd) { int res = 0; |