mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-07 02:18:15 +00:00
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
60 lines
2.2 KiB
C
60 lines
2.2 KiB
C
/*
|
|
* Prototypes for public functions only of internal interest,
|
|
* normally not used by modules.
|
|
* What goes here are typically *_init() routines.
|
|
*/
|
|
|
|
/*! \file
|
|
*
|
|
* \brief
|
|
* Prototypes for public functions only of internal interest,
|
|
*
|
|
*/
|
|
|
|
|
|
#ifndef _ASTERISK__PRIVATE_H
|
|
#define _ASTERISK__PRIVATE_H
|
|
|
|
int load_modules(unsigned int); /*!< Provided by loader.c */
|
|
int load_pbx(void); /*!< Provided by pbx.c */
|
|
int init_logger(void); /*!< Provided by logger.c */
|
|
void close_logger(void); /*!< Provided by logger.c */
|
|
int init_framer(void); /*!< Provided by frame.c */
|
|
int ast_term_init(void); /*!< Provided by term.c */
|
|
int astdb_init(void); /*!< Provided by db.c */
|
|
void ast_channels_init(void); /*!< Provided by channel.c */
|
|
void ast_builtins_init(void); /*!< Provided by cli.c */
|
|
int dnsmgr_init(void); /*!< Provided by dnsmgr.c */
|
|
void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */
|
|
int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */
|
|
void threadstorage_init(void); /*!< Provided by threadstorage.c */
|
|
int ast_event_init(void); /*!< Provided by event.c */
|
|
int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */
|
|
int astobj2_init(void); /*!< Provided by astobj2.c */
|
|
int ast_file_init(void); /*!< Provided by file.c */
|
|
int ast_features_init(void); /*!< Provided by features.c */
|
|
void ast_autoservice_init(void); /*!< Provided by autoservice.c */
|
|
int ast_http_init(void); /*!< Provided by http.c */
|
|
int ast_http_reload(void); /*!< Provided by http.c */
|
|
int ast_tps_init(void); /*!< Provided by taskprocessor.c */
|
|
int ast_timing_init(void); /*!< Provided by timing.c */
|
|
|
|
/*!
|
|
* \brief Reload asterisk modules.
|
|
* \param name the name of the module to reload
|
|
*
|
|
* This function reloads the specified module, or if no modules are specified,
|
|
* it will reload all loaded modules.
|
|
*
|
|
* \note Modules are reloaded using their reload() functions, not unloading
|
|
* them and loading them again.
|
|
*
|
|
* \return 0 if the specified module was not found.
|
|
* \retval 1 if the module was found but cannot be reloaded.
|
|
* \retval -1 if a reload operation is already in progress.
|
|
* \retval 2 if the specfied module was found and reloaded.
|
|
*/
|
|
int ast_module_reload(const char *name);
|
|
|
|
#endif /* _ASTERISK__PRIVATE_H */
|