diff options
author | Joshua Colp <jcolp@digium.com> | 2015-02-15 17:42:34 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-02-15 17:42:34 +0000 |
commit | c8f3074cc4b96a884d67c70b74dfacf68272773a (patch) | |
tree | 47303d7220e8c5d995b6d0893205354c5c482779 /contrib/scripts | |
parent | a3044cbf02c2f727fc8cda87ed64acbaafce11ef (diff) |
res_sorcery_config: Improve object lookup times.
The res_sorcery_config module currently uses a fixed bucket
size of 53. This means that depending on the number of objects
you either end up with excess buckets or a lot of collisions.
Due to the way that res_sorcery_config is implemented it's actually
possible to make the bucket size dynamic based on the number of
objects. This is due to the fact that each loading of the config file
produces a new container and does not modify the existing one.
This change uses the number of expected objects and finds a prime
number near it. In practice depending on the number of objects this
can speed up lookups anywhere from 2X to 15X. This change also removes
the lock from the container as it is not needed.
Review: https://reviewboard.asterisk.org/r/4423/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/scripts')
0 files changed, 0 insertions, 0 deletions