Hi,

as the startup size of the character buffer is concerned, the system id
is known when the tiny document is instantiated; so one can write
something like this:

 

Class TinyTree {

      public void createDocument () {

            File f = new File(getSystemId());       

            int s = (int)f.length();

            if (s == 0)

                  s = 4000;

            else

                  s -= 20 * s / 100;

           

            currentDocument = new TinyDocumentImpl(4000, 100, 20, s);

           

            TinyDocumentImpl doc = (TinyDocumentImpl)currentDocument;

            doc.setSystemId(getSystemId());

            doc.setNamePool(namePool);

      }

But I do not know, if such a heuristic could really speed up
tree build time by reducing the number of reallocations.

Anyway many thanks for your quick response!

 

Best regards

K.Rucker

 

 

-----Ursprüngliche Nachricht-----
Von: Michael Kay [mailto:mhk@mhk.me.uk]
Gesendet: Freitag, 19. Dezember 2003 11:45
An: saxon-help@lists.sourceforge.net
Betreff: RE: [saxon] Standard Tree, Tiny Tree

 

 

-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Rucker, Karsten
Sent:
19 December 2003 05:17
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Standard Tree, Tiny Tree