[asterisk-dev] [Code Review] 2884: Performance: Remove dispatch object allocation from Stasis publishing
David Lee
reviewboard at asterisk.org
Fri Sep 27 16:42:02 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2884/
-----------------------------------------------------------
(Updated Sept. 27, 2013, 4:42 p.m.)
Review request for Asterisk Developers.
Changes
-------
Add local_data unit test.
And it passes!
Repository: Asterisk
Description
-------
While looking for areas for performance improvement, I realized that an
unused feature in Stasis was negatively impacting performance.
When a message is sent to a subscriber, a dispatch object is allocated
for the dispatch, containing the topic the message was published to, the
subscriber the message is being sent to, and the message itself.
The topic is actually unused by any subscriber in Asterisk today. And
the subscriber is associated with the taskprocessor the message is being
dispatched to.
First, this patch removes the unused topic parameter from Stasis
subscription callbacks.
Second, this patch introduces the concept of taskprocessor local data,
data that may be set on a taskprocessor and provided along with the data
pointer when a task is pushed using the ast_taskprocessor_push_local()
call. This allows the task to have both data specific to that
taskprocessor, in addition to data specific to that invocation.
With those two changes, the dispatch object can be removed completely,
and the message is simply refcounted and sent directly to the
taskprocessor.
Diffs (updated)
-----
/team/dlee/stasis-forward-optimization/apps/app_meetme.c 399870
/team/dlee/stasis-forward-optimization/apps/app_queue.c 399870
/team/dlee/stasis-forward-optimization/apps/app_voicemail.c 399870
/team/dlee/stasis-forward-optimization/apps/confbridge/confbridge_manager.c 399870
/team/dlee/stasis-forward-optimization/channels/chan_dahdi.c 399870
/team/dlee/stasis-forward-optimization/channels/chan_iax2.c 399870
/team/dlee/stasis-forward-optimization/channels/chan_mgcp.c 399870
/team/dlee/stasis-forward-optimization/channels/chan_sip.c 399870
/team/dlee/stasis-forward-optimization/channels/chan_skinny.c 399870
/team/dlee/stasis-forward-optimization/channels/sig_pri.c 399870
/team/dlee/stasis-forward-optimization/funcs/func_presencestate.c 399870
/team/dlee/stasis-forward-optimization/include/asterisk/stasis.h 399870
/team/dlee/stasis-forward-optimization/include/asterisk/stasis_internal.h 399870
/team/dlee/stasis-forward-optimization/include/asterisk/taskprocessor.h 399870
/team/dlee/stasis-forward-optimization/main/ccss.c 399870
/team/dlee/stasis-forward-optimization/main/cdr.c 399870
/team/dlee/stasis-forward-optimization/main/cel.c 399870
/team/dlee/stasis-forward-optimization/main/devicestate.c 399870
/team/dlee/stasis-forward-optimization/main/endpoints.c 399870
/team/dlee/stasis-forward-optimization/main/manager.c 399870
/team/dlee/stasis-forward-optimization/main/manager_bridges.c 399870
/team/dlee/stasis-forward-optimization/main/manager_channels.c 399870
/team/dlee/stasis-forward-optimization/main/manager_endpoints.c 399870
/team/dlee/stasis-forward-optimization/main/manager_mwi.c 399870
/team/dlee/stasis-forward-optimization/main/pbx.c 399870
/team/dlee/stasis-forward-optimization/main/sounds_index.c 399870
/team/dlee/stasis-forward-optimization/main/stasis.c 399870
/team/dlee/stasis-forward-optimization/main/stasis_cache.c 399870
/team/dlee/stasis-forward-optimization/main/stasis_message_router.c 399870
/team/dlee/stasis-forward-optimization/main/stasis_wait.c 399870
/team/dlee/stasis-forward-optimization/main/taskprocessor.c 399870
/team/dlee/stasis-forward-optimization/res/parking/parking_applications.c 399870
/team/dlee/stasis-forward-optimization/res/parking/parking_bridge_features.c 399870
/team/dlee/stasis-forward-optimization/res/parking/parking_manager.c 399870
/team/dlee/stasis-forward-optimization/res/res_agi.c 399870
/team/dlee/stasis-forward-optimization/res/res_chan_stats.c 399870
/team/dlee/stasis-forward-optimization/res/res_jabber.c 399870
/team/dlee/stasis-forward-optimization/res/res_pjsip_mwi.c 399870
/team/dlee/stasis-forward-optimization/res/res_pjsip_refer.c 399870
/team/dlee/stasis-forward-optimization/res/res_security_log.c 399870
/team/dlee/stasis-forward-optimization/res/res_stasis_test.c 399870
/team/dlee/stasis-forward-optimization/res/res_xmpp.c 399870
/team/dlee/stasis-forward-optimization/res/stasis/app.c 399870
/team/dlee/stasis-forward-optimization/tests/test_devicestate.c 399870
/team/dlee/stasis-forward-optimization/tests/test_stasis.c 399870
/team/dlee/stasis-forward-optimization/tests/test_taskprocessor.c 399870
Diff: https://reviewboard.asterisk.org/r/2884/diff/
Testing
-------
Unit tests pass.
Thanks,
David Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130927/1a62301a/attachment-0001.html>
More information about the asterisk-dev
mailing list