[
Lists Home |
Date Index |
Thread Index
]
> genxElement genxDeclareElement(genxWriter w, utf8Byte * namespaceURI,
> utf8Byte * type);
> genxAttribute genxDeclareAttribute( ... same args ... );
>
> Then you have
>
> int genxFastStartElement(genxWriter w, genxElement element);
> int genxFastAttribute(genxWriter w, genxAttribute attribute, utf8Byte *
> value);
>
> I think that with a little bit of care in the code, this should
> generate guaranteed-WF canonical XML at speeds close enough to the most
> deranged pedal-to-the-metal custom C code to vanish in the static of
> any conceivable application. Would this be premature optimization?
It sounds to me like manual reference counting in an environment where
automatic garbage collection is available; I would prefer a little
slower optimization, which memoizes pointers to strings and compares
strings by reference, then by value. It will be almost as fast
for most applications, and the user will have the freedom to do exactly the
same to optimize -- to predeclare the names in one place, without
keeping extra variables when it does not need to.
David Tolpin
|