Quote Originally Posted by Chebmaster
Things like this
[pascal]while (IText <Length> #32) do
begin
Part := Part+Text[IText]; [/pascal]
kill performance on the spot. Brutally.

EACH time you add a char to a string, a call to realloc its memory is performed. So you can imagine how "fast" will this code execute.

Ideally, you should make two passes. The first one determines subsstring lengths and positions, the second pass allocates memory by calling SetLength for destination strings (once!) and copies the characters.
Thanks for pointing that out. I still haven't concentrated on lower level optimizations... I'm solving the general problems for my engine, and making all the code to be as useful as possible. For example that function I posted helps to parse data in many different situations. And while reading you comment, I was thinking that is not hard to optimize that function, if the problem is allocating one character at a time, I would just allocate in big blocks (i.e. 256 bytes) and finally cutting it down to the required size. On the other hand, I wouldn't use parsing functions on places that are time critical anyway. It always depends on the given problem.

Quote Originally Posted by Chesso
XML from what I know and have heard, is basically not that great performance wise, I high doubt it outperforms ini files, or atleast wouldn't if ini file handler was improved (as the basic fact is, an INI file is simpler then an XML file, atleast as far as I know).

But people shouldn't be using it for it's performance, but for it's ease of structure.

If you want performance, XML isn't the way to go, nor is INI.
That's true. And XML is for easy exchange of data between systems.