Version 1 (modified by cameron, 11 years ago) (diff)


In-line Substitution Architecture

These notes discuss how in-line substitution is and/or should be used for high-performance in the Parabix engine. Notes initiated July 11, 2008 RDC.

ILAX: In-line API for XML

Parabix presently employs a SAX-like interface that allows action routines to be in-line directly into the engine. This can avoid the procedure call overhead of multiple fine-grained parsing actions. It also allows the action procedures greater access to the resources of the engine, including for example, the use of pull-mode parsing within an overall push parser.

In-line Controls

Methods for finer-grained control of inlining as part of Parabix compilation are required.

The potential value of inlining particular routines should be based on how frequently they are or may be called. The following hierarchy may be considered.

  1. Actions invoked on a byte-by-byte basis.
  2. Actions invoked once per XML token.
  3. Actions invoked once per XML element.
  4. Actions invoked once per buffer (e.g., for 100K buffers).
  5. Actions invoked once per document.

Presently, we are having problems with too many routines being inlined. Using the normal C++ semantics, all methods are identified as inlining candidates by default. As a result, the compiler generally runs into inlining limits before considering all reasonable inlining of critical routines.

An initial experiment would be to identify all routines in classes 4 and 5 in the above list, and tag their declarations with attribute((no inline)).