Changeset 1096


Ignore:
Timestamp:
Apr 8, 2011, 7:26:14 PM (8 years ago)
Author:
ksherdy
Message:

Minor updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/PACT2011/02-background.tex

    r1084 r1096  
    44\subsection{XML}
    55In 1998, the W3C officially adopted XML as a standard. XML is a platform-independent data interchange format. The defining characteristics of XML are that it can represent virtually any type of information through the use of self-describing markup tags and can easily store semi-structured data in a descriptive fashion. XML markup encodes a description of an XML document's storage layout and logical structure. Because XML was intended to be human-readable, XML markup tags are often verbose by design \cite{TR:XML}.
    6 For example, a typical XML file could be:
     6An example of XML document is as follows.
    77
    88\begin{figure}[h]
     
    1818   <Price>$19.95</Price>
    1919  </Product>
    20   ...
    2120 </Products>
    2221\end{verbatim}
    2322}
    24 \caption{XML Document Fragment}\label{fig:sample_xml}
     23\caption{Example XML Document}\label{fig:sample_xml}
    2524\end{figure}
    2625
     
    2827
    2928
    30 XML files can be classified as ``document-oriented'' or ``data-oriented'' \cite{DuCharme04}. Documented-oriented XML is designed for human readability, such as shown in Figure \ref{fig:sample_xml}; data-oriented XML files are intended to be parsed by machines and omit any ``human-friendly'' formatting techniques, such as the use of whitespace and descriptive ``natural language'' naming schemes.  Although the XML specification itself does not distinguish between ``XML for documents'' and ``XML for data'' \cite{TR:XML}, the latter often requires the use of an XML parser to extract the information within. The role of an XML parser is to transform the text-based XML data into an application-ready format.
     29XML files can be classified as ``document-oriented'' or ``data-oriented'' \cite{DuCharme04}. Documented-oriented XML is designed for human readability, such as shown in Figure \ref{fig:sample_xml}; data-oriented XML files are intended to be parsed by machines and omit ``human-friendly'' formatting techniques, such as the use of whitespace and descriptive ``natural language'' naming schemes.  Although the XML specification itself does not distinguish between ``XML for documents'' and ``XML for data'' \cite{TR:XML}, the latter often requires the use of an XML parser to extract the information within. The role of an XML parser is to transform the text-based XML data into application ready data.
    3130%For example, an XML parser for a web browser may take a XML file, apply a style sheet to it, and display it to the end user in an attractive yet informative way; an XML database parser may take a XML file and construct indexes and/or compress the tree into a proprietary format to provide the end user with efficient relational, hierarchical, and/or object-based query access to it.
    3231
     
    3534\subsection{Traditional XML Parsers}
    3635% However, textual data tends to consist of variable-length items in generally unpredictable patterns \cite{Cameron2010}.
    37 Traditional XML parsers process XML sequentially a single byte-at-a-time. Following this approach, an XML parser processes a source document serially, from the first to the last byte of the source file. Each character of the source text is examined in turn to distinguish between the XML-specific markup, such as an opening angle bracket `<', and the content held within the document. The current character that the parser is processing is refered to as its cursor position. As the parser moves the cursor through the source document, the parser alternates between markup scanning, and data validation and processing operations. At each processing step, the parser scans the source document and either locates the expected markup, or reports an error condition and terminates. In other words, traditional XML parsers are complex finite-state machines that use byte comparisons to transition between data and metadata states. Each state transition indicates the context in which to interpret the subsequent characters. Unfortunetly, textual data tends to consist of variable-length items in generally unpredictable patterns \cite{Cameron2010}; thus any character could be a state transition until deemed otherwise.
     36Traditional XML parsers process XML sequentially a single byte-at-a-time. Following this approach, an XML parser processes a source document serially, from the first to the last byte of the source file. Each character of the source text is examined in turn to distinguish between the XML-specific markup, such as an opening angle bracket `<', and the content held within the document. The current character that the parser is processing is commonly referred to using the concept of a current cursor position. As the parser moves the cursor through the source document, the parser alternates between markup scanning, and data validation and processing operations. At each processing step, the parser scans the source document and either locates the expected markup, or reports an error condition and terminates. In other words, traditional XML parsers are complex finite-state machines that use byte comparisons to transition between data and metadata states. Each state transition indicates the context in which to interpret the subsequent characters. Unfortunetly, textual data tends to consist of variable-length items sequenced in generally unpredictable patterns \cite{Cameron2010}; thus any character could be a state transition until deemed otherwise.
    3837
    39 Expat and Xerces-C are popular byte-a-time sequential parsers. Both are C/C++ based and open-source. Expat was originally released in 1998; it is currently used in Mozilla Firefox and Open Office \cite{expat}. Xerces-C was released in 1999 and is the foundation of the Apache XML project \cite{xerces}. For example, the main loop of Xerces-C well-formedness scanner contains:
     38Expat and Xerces-C are popular byte-a-time sequential parsers. Both are C/C++ based and open-source. Expat was originally released in 1998; it is currently used in Mozilla Firefox and forms the core of many additional XML processing tools \cite{expat}. Xerces-C was released in 1999 and is the foundation of the Apache XML project \cite{xerces}.
    4039
     40% For example, the main loop of Xerces-C well-formedness scanner contains:
    4141%\begin{verbatim}
    4242%   XXXXXXXXXX   XERCES CODE   XXXXXXXXXX
    4343%\end{verbatim}
    4444
    45 The major disadvantage of the byte-at-a-time sequential approach to XML parsering is that each character incurs at least one conditional branch. The cummulative effect of branch mispredictions penalties are known to degrade parsing performance in proportion to the markup density of the source document \cite{CameronHerdyLin2008} (i.e., the proportion of XML-markup vs. XML-data).
     45A major disadvantage of the sequential byte-at-a-time approach to XML parsing is that each XML character incurs at least one conditional branch. The cummulative effect of branch mispredictions penalties are known to degrade XML parsing performance in proportion to the markup density of the source document \cite{CameronHerdyLin2008} (i.e., the proportion of XML-markup vs. XML-data).
    4646
    4747\subsection {Parallel XML Parsing}
    4848In general, parallel XML acceleration methods comes in one of two forms: multithreaded approaches and SIMD-based techniques.
    4949Multithreaded XML parsers take advantage of multiple cores via number of strategies.
    50 Approaches include preparsing the XML file to locate key partitioning points \cite{ZhangPanChiu09} and speculative p-DFAs \cite{ZhangPanChiu09}.
    51 Once divided, the XML workload is processed independently across the available cores. SIMD XML parsers leverage the
    52 SIMD registers to overcome the performance limitations of the byte-at-a-time sequential processing paradigm as well as
    53 inherent data dependent branch misprediction rates.  SIMD instructions allow the processor to perform the same
     50Common strategies include preparsing the XML file to locate key partitioning points \cite{ZhangPanChiu09} and speculative p-DFAs \cite{ZhangPanChiu09}.
     51SIMD XML parsers leverage the SIMD registers to overcome the performance limitations of the sequential byte-at-a-time processing model and its
     52inherent data dependent branch misprediction rates.  Further, SIMD instructions allow the processor to perform the same
    5453operation on multiple pieces of data simultaneously.  The Parabix1 and Parabix2 parsers studied in this paper
    55 fall in this class and are described in more detail in Section \ref{section:parabix} following.
     54fall into the SIMD classification and are described in more detail in Section \ref{section:parabix}.
    5655
    5756%\subsection {SIMD Operations}
Note: See TracChangeset for help on using the changeset viewer.