]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Cache global config options. 80/3480/2
authorRichard Mudgett <rmudgett@digium.com>
Fri, 5 Aug 2016 01:11:29 +0000 (20:11 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 25 Aug 2016 23:09:27 +0000 (18:09 -0500)
commita8771d7a71e5a5ec6c7a635d35bc2e8b1c717756
tree3978858e8980074b036a28b10df797ef1ccb5ce0
parent5a488431857147dc8b4d8c0f9b831f629afc2b23
res_pjsip: Cache global config options.

We may check a global config option hundreds of times a second or more.
Asking sorcery for the global configuration from the config files backend
involves several allocations and container traversals.  Using realtime
without a memory cache is a lot worse because you have to lookup in the
realtime database each time to reconstitute the sorcery object.  With a
memory cache for realtime, there is about the same amount of overhead as
for config files.  Either way, it is still fairly expensive to access the
sorcery object that much.

* Cache the global config options so we can access them faster.  You must
now always perform a res_pjsip reload to change the global options.

Change-Id: Ice16c7a4cbca4614da344aaea21a072b86263ef7
CHANGES
res/res_pjsip/config_global.c