Module: sip-router Branch: master Commit: 888d1d5644a38e8c36ed706ee51015984971cc5c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=888d1d56...
Author: Peter Dunkley peter.dunkley@crocodile-rcs.com Committer: Peter Dunkley peter.dunkley@crocodile-rcs.com Date: Mon Mar 19 15:54:23 2012 +0000
modules_k/pua: PUA DB-only mode performance improvements
- When the PUA DB-only mode was implemented it was designed to do (as close as possible) exactly what the hash-table mode did in the same way the hash-table mode did it.
This means lots of hash-table lookups (which are fast) result in lots of DB selects (which are slow). It also means where an entry is found in the hash-table and modified in place, in DB mode a select must be done and then an update.
A lot of these DB transactions are not strictly necessary, and often fields were retrieved or updated in the DB even when they hadn't changed. - This change refactors the DB-only code (in pua_db.c) and re-orders the functional code (in send_(publish|subscribe).c) to make the DB operations as simple as possible and as few as few as possible.
---
modules_k/pua/pua_db.c | 882 +++++++++++++++++----------------------- modules_k/pua/pua_db.h | 16 +- modules_k/pua/send_publish.c | 157 ++++---- modules_k/pua/send_subscribe.c | 298 +++++--------- 4 files changed, 571 insertions(+), 782 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=888d...