[Asterisk-code-review] main/pbx: Improve performance of dialplan reloads with large... (asterisk[13])

Matt Jordan asteriskteam at digium.com
Thu Apr 30 14:06:34 CDT 2015


Matt Jordan has posted comments on this change.

Change subject: main/pbx: Improve performance of dialplan reloads with large numbers of hints
......................................................................


Patch Set 1:

(5 comments)

https://gerrit.asterisk.org/#/c/312/1/main/pbx.c
File main/pbx.c:

Line 1051: 	AST_VECTOR(, char *) devices; /*!< Devices associated with the hint */
> Seems like this could be const
Fixed.


Line 1123: 	break;
> Nitpick: All of the breaks in this switch statement are indented oddly. Typ
Fixed.


Line 1132: 		/* Sort can only work on something with a full or partial key. */
> I don't understand this comment.
I think it had context in the ao2 callback code that I based this on originally; removed.


Line 1152: 		dev_iter = ao2_t_callback(hintdevices, OBJ_SEARCH_KEY | OBJ_MULTIPLE,
         : 			hintdevice_cmp_multiple, device, "find devices in container");
> Since the goal of this is to remove items from the hintdevices container, w
Actually, I think this comment exposes a bug here.

The goal of this patch _has_ to be to call CMP_STOP at some point. If all we are doing is calling CMP_MATCH, I'm never going to stop once I find the device/hint match. If so, then I really do need to use an ao2_callback here in a pattern that takes both the device and the hint, so that CMP_STOP is called. That would also remove the need to get multiple devices back, as you should always have only one device to one hint.


Line 1163: 		AST_VECTOR_REMOVE_UNORDERED(&hint->devices, i);
         : 		ast_free(device);
         : 		AST_VECTOR_INSERT(&hint->devices, i, NULL);
> I'm guessing the idea behind these two vector invocations is to get rid of 
Yeah, that should be much better.


-- 
To view, visit https://gerrit.asterisk.org/312
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iedfc97a69d21070c50fca42275d7b3e714e59360
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list