<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2883/">https://reviewboard.asterisk.org/r/2883/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By David Lee.</div>
<p style="color: grey;"><i>Updated Sept. 27, 2013, 5:03 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">swapped comparator args, to match the docs.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch optimizes how forwards are dispatched in Stasis.
Originally, forwards were dispatched as subscriptions that are invoked
on the publishing thread. This did not account for the vast number of
forwards we would end up having in the system, and the amount of work it
would take to walk though the forward subscriptions.
This patch modifies Stasis so that rather than walking the tree of
forwards on every dispatch, when forwards and subscriptions are changed,
the subscriber list for every topic in the tree is changed.
This has a couple of benefits. First, this reduces the workload of
dispatching messages. It also reduces contention when dispatching to
different topics that happen to forward to the same aggregation topic
(as happens with all of the channel, bridge and endpoint topics).
Since forwards are no longer subscriptions, the bulk of this patch is
simply changing stasis_subscription objects to stasis_forward objects
(which, admittedly, I should have done in the first place.)
Since this required me to yet again put in a growing array, I finally
abstracted that out into a set of ast_vector macros in
asterisk/vector.h.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Unit tests pass.
Performance testing to verify the speed up.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/team/dlee/taskprocessor-optimization/apps/app_queue.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/include/asterisk/stasis.h <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/include/asterisk/vector.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/cdr.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/cel.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/channel_internal_api.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/manager.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/manager_bridges.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/manager_channels.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/manager_mwi.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/manager_system.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/stasis.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/main/stasis_cache_pattern.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/res/stasis/app.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/tests/test_stasis.c <span style="color: grey">(399869)</span></li>
<li>/team/dlee/taskprocessor-optimization/tests/test_stasis_endpoints.c <span style="color: grey">(399869)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2883/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>