摘要
在满足SIP协议被设计为可灵活扩展的文本协议的要求的基础上,分析了传统SIP消息解析器中基于字符串比较操作来判断消息头字段类型对整体SIP消息解析性能的影响。结合SIP协议栈实现过程中的对可维护性和可扩展性要求,深入研究了逐行解析消息头字段的基本流程和静态查找表的基本工作原理,提出了借助开源工具Gperf自动化构建高效静态查找表以实现头字段类型查询的方法,并实现了SIP消息头类型的快速匹配的目的。该方法改善了SIP消息解析器的性能和扩展性。
To enhance the performance of SIP header detecting process during the SIP message parsing with the consideration of the design principle of flexibility of SIP protocol,a detailed analysis on efficiency of string comparison to determine the type of SIP header which may introduce performance issue,shows that traditional string operation should be replaced with some faster methods.A new method is proposed based on analyses of the basic procedure of parsing SIP header in line model and practices the open source Gperf for generating perfect hash function.And then this method leverages the searching static hash table of SIP header names for determining SIP header type to improve the parsing performance of SIP decoder and ability of SIP header extension.
出处
《计算机工程与设计》
CSCD
北大核心
2010年第13期2988-2991,2995,共5页
Computer Engineering and Design