RE: [GD-General] XML parsers (was: A portable preferences library)
Brought to you by:
vexxed72
From: Richard S. <Ric...@ei...> - 2003-12-05 14:00:52
|
> > And indeed, to get game-quality optimisations, I'll have to > > write my own micro XML parser so we can stop using Xerces > Xerces? We decided against using a validating parser, > and are happily using expat.=20 The fully validating parser is there as a launch pad, really. The provided parser and tools allows us to get off the ground quickly and easily, the validation forces us to produce a well specced formal grammar (XML schema, in this case). The schema can also then be used by editors to provide good quality language validation. Once all this is in place, it is our intent to replace the XML editors with an editing tool specific to the language, which then removes the need for the validation. At which time we will replace Xerces with a home-grown parser. So far it has worked out extremely well - much better than I had anticipated. > We have around 1500 XMLs in a game > installation. We don't have tests for how long it takes to=20 > load them all, > because they most of them are loaded on demand, but in normal=20 > gaming sessions > (load the game and play 30-40 minutes) profiles showed that > total time spent inside expat was < 500 ms. Ah, I think we'll have less XML files, but much of our overhead will be coming from processing the rules out from the parsed XML and binding XML data content to game functionality. Also in a given gametick, these rules may need to be run many hundreds of times, using different data in each case. We have a fallback=20 plan in case this overhead is too much (given there is no real alternative) is to retranslate the XML automagically into C++. Actually, it might be easy enough to do this that I'll do it anyway - it can't hurt and it would be an interesting exercise. Rich |