使用JSON对AJAX技术中的XML性能的优化仿真
2009年第08期,第42卷 通 信 技 术 Vol.42,No.08,2009
总第212期 Communications Technology No.212,Totally
使用JSON对 AJAX 技术中的XML 性能的优化仿真
①② ②
崔 璨 , 倪 宏
(①中国科学技术大学自动化系,安徽 合肥 230026;
②中国科学院声学所国家网络新媒体工程技术研究中心,北京 100190)
【摘 要】针对现有Web Application开发中比较流行AJAX技术思想,其数据负载格式XML(Extensible Markup Language,
可扩展标记语言)需要通过 DOM(Document Object Model,文件对象模型)进行解析,导致系统资源占用较多,对于性能不
够强劲的浏览器来说文件解析资源消耗严重的问题,寻求了一种支持JavaScript的,较XML来说更为轻量级的数据负载格式
JSON(JavaScript Object Notation,JavaScript 对象标记),分析了其作为 AJAX 中的 XML 替代格式的优势。利用 JSON 作
为 AJAX 中的数据负载格式,屏蔽了 DOM 解析 XML 文件的复杂性,更好的支持了 JavaScript 的数据读取,大大提高了页面呈
现的实时性,实践证明,JSON在AJAX中的性能表现要大大优于XML。
【关键词】可扩展标记语言,轻量级数据负载格式,性能优化
【中图分类号】TP393.092 【文献标识码】A 【文章编号】1002-0802(2009)08-0108-03
Optimization Simulation of XML Performance Based on JSON
①② ②
CUI Can , NI Hong
(①Department of Automation , University of Science and Technology of China, Hefei Anhui 230026, China;
②National Network New Media Engineering and Technological Research Center, Institute of Acoustics,Chinese Academy of Science, Beijing
100190, China)
【Abstract】To solve the problems in data load format XML of AJAX technology for using more system resource,
being hard to parse for the browers which has a low performance, as it parses documents using DOM(Document Object
Model), a even more light-weight data-interchange format JSON(JavaS