-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4423/
-----------------------------------------------------------

Review request for Asterisk Developers.


Repository: Asterisk


Description
-------

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.


Diffs
-----

  /branches/13/res/res_sorcery_config.c 431750 

Diff: https://reviewboard.asterisk.org/r/4423/diff/


Testing
-------

Confirmed that a close prime number was chosen using the debug message 
depending on the number of objects. Confirmed that objects can still be looked 
up. Did some spot checking with 10,000+ endpoints to see performance impact.


Thanks,

Joshua Colp

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to