I guess I can improve that explanation a bit: Maybe "direct-via-if" is misleading. For a "direct" user, the IF is never converted to the actual IF XML format. All calls from the IFRenderer are made directly against the IFDocumentHandler and IFPainter interfaces (for example PDFDocumentHandler and PDFPainter). You can look at the IFDocumentHandler/IPFPainter pair like at the SAX ContentHandler. It's used to tie together a XML processing pipeline without serializing the actual XML. Only the info set is transported but in an in-memory form native to Java. The same is done with IFDocumentHandler/IFPainter. The idea is not to cause a performance penalty for "direct" users but still allow the advanced functionality for advanced use cases.
On 18.02.2009 10:29:54 Jeremias Maerki wrote: > Hi Georg > > On 18.02.2009 10:13:21 Georg Datterl wrote: > > Hi Jeremias, > > > > > I've also made performance measurements as part of this effort which > > > highlights why it was done in the first place: > > > http://people.apache.org/~jeremias/fop/benchmark-2009-02-13/ > > > > I'm probably missing something important here, but regarding the first > > graph: > > > > Isn't "direct" what ordinary users of fop do? Take a fo-file and then > > render it? > > Yes. > > > Isn't "direct-via-if" what ordinary users of fop will do in the future, if > > IF is the default? > > Yes. > > > Isn't the work done in "direct-via-if" the sum of the work done in "to-if" > > and "from-if"? > > No. "to-if" renders the FO and uses IFSerializer (called by IFRenderer) to > write an intermediate file. "from-if" parses the intermediate file > (using IFParser) and generates a series of calls against an > IFDocumentHandler and IFPainter implementation. So: > > "direct-via-if" = "to-if" + "from-if" - serializing IF - parsing IF > or > "to-if" + "from-if" = "direct-via-if" + serializing IF + parsing IF > > The main motivation for the new IF is the fact that "serializing AT XML" > and especially "parsing AT XML" is very costly. > > See also http://people.apache.org/~jeremias/fop/renderer-design-new.png > which shows the two different paths. > > > And, if all the above answers are yes, why is the performance gain > > noticed in "from-if" not more obviously related to the performance gain > > in "direct-via-if"? > > There was a "no" above so this is not applicable anymore. I hope I could > clear up the gap. > > > > Jeremias Maerki > Jeremias Maerki