-----BEGIN PGP SIGNED MESSAGE-----
[ For the public record ]
/ Norman Walsh <saxon@...> was heard to say:
| / "Michael Kay" <michael.h.kay@...> was heard to say:
| | There's something funny going on here. How long does it take to navigate
| | your graph if you don't build the tree?
| I added a little timing code. Walking the graph to build the tree
| takes 172ms; walking the tree and doing nothing else takes 8ms;
| walking the tree again, calling the emitter takes 92881ms.
/ After a couple of private exchanges, Mike said:
>Right, I can begin to see what's going on. I had quite forgotten the way
>this worked in the 6.5 branch. The code for result tree fragments is trying
>desperately hard to delay building a tree, which it does by instead holding
>a list of Emitter events, which are then replayed if the RTF is copied, or
>otherwise used as a tree, but not if the RTF is simply used as a string.
>This was more efficient than the fully linked "one object per node" tree
>implementation, but it turns out that it takes a lot more space (and
>therefore time) than the "tinytree", so in 7.x I build a tinytree directly.
>[But I never knew it was quite as bad as this for large trees!]
>I think the answer for you is to forget the FragmentValue approach, which is
>fairly bizarre and special purpose, and feed your emitter events directly
>into a com.icl.saxon.tinytree.TinyBuilder - which is also an Emitter. When
>the document has been fully built, you can access the document node using
Perfect. Using that approach, 92881ms is reduced to 1293ms. Much more
Thank you, Mike!
Be seeing you,
Norman Walsh <ndw@...> | Sometimes in life situations develop
http://nwalsh.com/ | that only the half-crazy can get out
| of.--La Rochefoucauld
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>
-----END PGP SIGNATURE-----