Summary:ASTERISK-18319: [patch] Optimize chan_sip.c check_rtp_timeout() function
Reporter:Rob Gagnon (rgagnon)Labels:
Date Opened:2011-08-22 13:14:58Date Closed:2011-08-31 13:16:48
Versions:1.4.42 Frequency of
Environment:AllAttachments:( 0) issue-18319-trunk-r333066.diff
Description:While reviewing how "rtptimeout" and "rtpholdtimeout" operate in code, I found that the check_rtp_timeout() function could be optimized a little to speed up asterisk performance.

Currently, three integers are fetched from the rtp instance multiple times apiece (causing of course, multiple stack operations)

In the worst-case scenario:
- ast_rtp_instance_get_timeout() is called 4 times.
- ast_rtp_instance_get_hold_timeout() is called 4 times.
- ast_rtp_instance_get_keepalive() is called 3 times.

With this patch, each function will be called only once, thus removing up to 9 stack push/pops during runtime.

Comments:By: Paul Belanger (pabelanger) 2011-08-23 10:28:18.055-0500

Thanks for the patch. I also suggest you add this to reviewboard for others to review.

By: Rob Gagnon (rgagnon) 2011-08-23 11:10:00.209-0500

Added reviewboard link

By: Rob Gagnon (rgagnon) 2011-08-23 14:02:49.056-0500

Replaced patch issue-18319-trunk-r332815.diff with issue-18319-r333058.diff to keep patch here inline with the diff on reviewboard

By: Rob Gagnon (rgagnon) 2011-08-23 15:07:47.972-0500

Replaced patch issue-18319-trunk-r333058.diff with issue-18319-r333066.diff to keep patch here inline with the diff on reviewboard