[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Refreshed genx.h, plus some plans
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|