Re: XML was RE: [GD-General] RE: A portable preferences library
Brought to you by:
vexxed72
From: J C L. <cl...@ka...> - 2003-12-16 21:08:26
|
On Tue, 16 Dec 2003 21:53:36 +0100 Alen Ladavac <ale...@cr...> wrote: > Nope, you missed the boat. :) Damn, I'm gonna fire that ranging scout! > The idea is that XML is a generic format, freeing you from writing > your parser. Precisely. > There is no much point storing plain blobs inside XML. Then, you can > just dump it with fwrite() as well. Dumping a blob in XML really isn't that much more difficult. You either drop it inline as a base64 or as a MIME attachment in base64. The data size grows by 30% of course, but that's expected as a text representation. > But the question is: If you save your vertices in x="1" y="0"...etc > format, can that still load as fast as if you just dump > 3f8000000000000...etc? Of course not. double foo[large_number]; ... read (h, foo, sizeof (foo[0]) * large_number) Is necessarily going to be cheaper than parsing an XML structure of large_number doubles. The only question is whether the added expense is worth it on some level. If you're shaving instructions... > People started to argue that the verboseness of the format doesn't > hinder its performance. I say, ok, it might be possible, but show me > the numbers. Didn't see any yet. :/ Frankly and numbers you see need to be treated with a lot of salt, even the ones I post. It is a simple enough thing to test with whatever parser you pick. -- J C Lawrence ---------(*) Satan, oscillate my metallic sonatas. cl...@ka... He lived as a devil, eh? http://www.kanga.nu/~claw/ Evil is a name of a foeman, as I live. |