khartsh wrote:YorrickVander wrote:The games own debug log might give some clue that this idea of constantly reading XML is complete rubbish. When the game loads the xml, it also checks your extensions folder; this can be validated by any player using mods as your mods would break if the game continued to reload without checking that folder too. So far so good
Any mods that modify the original xml via diff patch throw a debug log entry as unrecognised tags upon save game load or new game start; this is also good - we don't want this code to be actually run by the engine after patching. Which brings me to the nub of the evidence - these errors don't show again until another load/new start, and therefore pretty much disproves the idea that the xml is constantly reread in a manner that any player can verify with no need for profilers.
Does the game not store objects in xml format? Wouldn't it then be plausible that anytime something is modified, destroyed or created the xml file in question would have to be read, processed, modified, reloaded into memory and validated? Smarter people than I seem to think so.
You are confusing how data structures work in memory versus how they have to work on disk. XML formats are used on disk primarily because they are easy to read and link into a data structure in memory. However a data structure cannot be written to a disk in it's natural form due to the fact that files on a disk cannot reference themselves the same way data structures in memory can.
No sane programmer would ever use an XML format for a data structure. It is useful as it is easy to build a data structure based on, and easy for a human to read, but as a data structure it is a nightmare. You would in effect be storing everything as a string, and having to parse it every time you needed some information from it. Instead as they read the data structure in and parsed it, they would convert it into a more productive data format. This allows them to better reference data without having to go through all the parsing again.
Looking at this, if their program is spending resources on the XML module, it is likely either reading XML files from disk or creating data structures in memory. It could be that the module is responsible for more than XML as well. There are a lot of things I do not know lacking source code. However personally I am confident that they do not rely on XML during runtime data referencing. Such a thing would be limited to loading times.