]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Merged revisions 184339 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Wed, 25 Mar 2009 22:02:20 +0000 (22:02 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 25 Mar 2009 22:02:20 +0000 (22:02 +0000)
commit429e148ebfc41eb7ed4d939df545781c280a598d
tree8e01f20ee75ccf3ca9329414bb33400fff9ca5bc
parent892304ed9e2eab970ad2bc10696a9262072fa7ab
Merged revisions 184339 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r184339 | russell | 2009-03-25 16:57:19 -0500 (Wed, 25 Mar 2009) | 35 lines

Improve performance of the ast_event cache functionality.

This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@184342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
15 files changed:
apps/app_voicemail.c
channels/chan_dahdi.c
channels/chan_iax2.c
channels/chan_mgcp.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_unistim.c
include/asterisk/_private.h
include/asterisk/devicestate.h
include/asterisk/event.h
include/asterisk/strings.h
main/asterisk.c
main/devicestate.c
main/event.c
res/ais/evt.c