XML Memory Requirements (was Re: Feeling good about SML)

Tim Bray tbray at textuality.com
Sun Nov 21 17:07:14 GMT 1999


At 07:28 PM 11/18/99 -0500, Tyler Baker wrote:
>Other Java XML parsers I have seen use a similiar approach
>except that the store the character bitmap in the class file itself which has the unfortunate
>problem of bloating the size of your class file immensely, and slowing down startup time
>because the stupid way Java deals with constant arrays of primitive types in classes is that
>it generates instructions for initializing each section of the array to the desired value
>instead of just having a stream of bytes that are read into the array one by one.

Yes, indeed, Java is megastupid this way.  The workaround I ended up with was
smashing all the numbers together into a big String, which still makes a
large-ish class file (but you're going to have to transmit that data
one way or another anyhow), but only one run-time push statement.  

To use the data, there are a variety of tricks available dependig what it
is you've mashed into the String; in my case String.toCharArray() did
the trick. -T.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list