Design and implementation of high - performance the Jave SAX parser

Author
WangJianChao
Advisor
JinZuoHong
School
Institute of Software
Major
Computer Software and Theory
Classification
TP311.11 Programming method
Degree
Master's thesis
Year
2005
Downloads
174
Citations
4

Request the full text

Abstract

XML (extensible Markup Language) is designed to define various kinds of XML documents, which are widely used in the data transmission, data transition, data integration and document storage under Web environments. The XML parsing interface SAX (Simple API for XML) first appears in an open forum named XML-DEV. It is based on event-driven model which triggers a series of events for user’s handling while parsing a XML document. Although SAX doesn’t become an official recommended standard, it is actually widely adopted among developers and end-users.This thesis covers the design and implementation of a high performance SAX parser Once SAXParser. Once SAXParser has complete XML-parsing function, as well as scaliable and extensible architecture. We also made great efforts in the design to enhance Once SAXParser’s performance, such as simple data structure, effective finite automaton implementation, buffer management in lexical analyzer and state simplization of syntax parser. What’s more, we tried object-pool technology to reduce the CPU usage in objects’ creations and destructions, as well as some useful performance improvements in the programming language level.In order to test the function and interface comformance of Once SAXParser, we also built the XML comformance test suite for it. This suite extends the JUnit automation test architecture, which can automatically test more than 2,000 comformance testing cases. The final results show that Once SAXParser successfully passed all the cases in which most other parsers failed to pass.In the last, we tested Once SAXParser’s performance as well as the most popular Xerces with the XML Test suite tool from SUN microsystem. The results turned out to be a 30% performance advantage of our parser over the Xerces SAX Parser. So we come to the conclusion that the design and implementation of Once SAXParser is effective, together with function integrity.

Table of contents

Abstract 3-4 ABSTRACT 4-8 Introduction 8-11 1.1 Research Background <br / > 1.2 working papers 8-9 1.3 thesis organization 9-11 XML and its resolve 11-21 2.1 an XML and nbsp its analytical way; 11-15 2.1.1 XML history and specifications outlined 11-12 2.1.1.1 Overview of historical development 11-12 2.1.1.2 functionality and application 12 the 2.1.2 XML syntax foundation 12-14 2.1.3 Overview of the XML parsing methods 14-15 the XML parsing ways 2.2 JAVA 15-21 2.2.1 SAX interface 15-18 2.2.1.1 Introduction 15-16 2.2 .1.2 parsing process 16 2.2.1.3 components introduced 16-18 2.2.2 the DOM interface 18 2.2.3 the StAX Interface 2.2.4 parser 18-19 19-21 Chapter ONCE XML PARSER system structure 21-26 3.1 the ONCE XMLPARSER Overview 21 3.2 the ONCE XML PARSER architecture 21-22 3.3 ONCE XML PARSER module structure 22-26 3.3. 1 Common Utilities package 22-23 3.3.2 Once SAX package 23-24 3.3.3 Once the StAX package 24-25 3.3 .4 Once DOM package 25-26 Chapter lexer Design and Implementation 26-41 4.1 the lexer design 26-29 4.1.1 lexical analyzer 26 4.1.2 lexical analyzer class 26-29 4.1.2.1 Scanner Scanner11-class 27-28 4.1.2.2 EntityInfo classes nbsp a; 28-29 the the 4.1.2.3 XMLChar and XML11Char class 29 4.1.3 the lexical analyzer workflows 29 4.2 read terminator 29-39 4.2.1 to read a single character 30 4.2.2 reads character data 30-31 4.2.3 read legitimate name class terminator 31-34 4.2.4 to read other specified terminator 34-38 4.2.5 Skip specified terminator the read process terminator 38 4.2.6 nbsp the legal characters 38-39 4.3 judgment; 39-41 Design and Implementation of Chapter parser the 41-56 5.1 construct abstract syntax and automata 41-47 5.1.1 syntax definition. derivation 41-44 5.1.2 automata design the 44-47 5.2 SAXPARSER achieve 47-49 5.2.1 the SAXParser class composition 47-49 5.2.2 Handler callback 49 5.3 process flow 49-51 the 5.4 namespace NSSAXPARSER 51 -53 5.4.1 Overview 51-52 5.4.2 process flow nbsp the; 52-53 5.5 well-formedness constraints (WFC) to achieve 53-56 5.5.1 XML specification's well-formedness constraints 53-55 5.5.2 Namespace well-formedness constraints 55-56 <br / Chapter VI function and performance testing 56-63 6.1 Functional Test 56-59 6.1.1 the interface compatibility testing 56-57 <br / > 6.1.1.1 SAX2Unit Introduction 56-57 6.1.1.2 interfaces, compatibility test results 57 6.1.2 XML compatibility testing 57-59 6.1.2.1 XML Conformance Test Suite Introduction 57-58 6.1.2.2 XML compatibility testing design the 6.1.2.3 the XML compatibility test results of 58 58-59 6.2 performance test the the 6.2.1 performance test tools 59-63 XML Test the 59-61 6.2.2 Performance Test Results 61-63 Chapter VII of the performance optimization the 63-74 7.1 based on statistics automatically optimize 63-67 7.2 reasonable to select the character buffer size 67 the technology 7.3 Pooling the 67-71 the 7.3.1 pool of technology introduced 67-68 the 7.3.2 object pool design and achieve 68-69 the 7.3.3 performance test data and analysis 69-71 7.4 language level optimization 71-74 7.4. a modest package principle 71-72 7.4.2 to reduce simple method call 72-73 7.4.3 instead of the single-step \ 73-74 Chapter VIII Conclusion 74-76 8.1 work summary nbsp are; 74-75 8.1.1 XML parsing function 74 8.1.2 excellent analytical performance 74 8.1.3 flexible configurable scalable system the 8.2 further work on 74-75 75 -76 Reference 76-78 papers published during the study for a degree 78-79 thank the 79

Related dissertations

  1. Performance Testing and Optimization Based on the Portal and OA System of Electric Power Company
    TianZhiWei ·Suzhou University ·2007 ·Master's thesis
  2. Research of Database Performance Optimization in Large Scale Application System
    SongHaiPing ·Wuhan University of Technology ·2007 ·Master's thesis
  3. Performance Test and Analysis of Database for Color Ring Back Tone Service
  4. Research of Emulsion Pump Performance Test System
  5. Research and Design of Intelligent Prosthetic Knee Ankle Coordinated Control System
    BaiJian ·Hebei University of Technology ·2013 ·Master's thesis
  6. Humanoid Robot Embedded Vision System and Decision-making System
    LiuLei ·Harbin Institute of Technology ·2012 ·Master's thesis
  7. Research on Paramenters Identification and Experimental Platform of Large-scale Space Manipulator Joints
    ZhangFei ·Harbin Institute of Technology ·2012 ·Master's thesis
  8. Design and Implementation of Website Security Protection System
  9. Research on Performance Testing of IPv6Transition Technology
  10. Design and Implementation of the XProc Processor Based on.NET
  11. Design and Implementation of the XML Document Processing System Based on Xproc
  12. Research of Web Information Extraction Based on XML
    ZhengBangXi ·Dalian Jiaotong University ·2013 ·Master's thesis
  13. Research of Information Extraction from Web Documents Based on Tree Automaton
    YangFan ·East China Jiaotong University ·2013 ·Master's thesis
  14. Research and Application of Information Retrieval Based on XML Document
    HuZuoZuo ·Shandong University ·2013 ·Master's thesis
  15. Research of Keyword Query Processing on XML Data
    ZhaoXingMin ·Yanshan University ·2013 ·Master's thesis
  16. Research on Subtree Results Generation of XML Keyword Search
    WangBo ·Yanshan University ·2013 ·Master's thesis
  17. Results Diversification for XML Keyword Search Based on Semantics
    SongYuLing ·Beijing Jiaotong University ·2014 ·Master's thesis
  18. Agent-based Research and Implementation on Simulation Modeling and Scenario in Battlefield Environment
  19. Analog Electronic Technology Experiment Based on Virtual and Practicality Combined Lab
    HeZhenLei ·Zhejiang University ·2013 ·Master's thesis
  20. Power Electronic Remote Experiment Under Virtual and Reality Combination Framework
    ShenZhangBiao ·Zhejiang University ·2014 ·Master's thesis