Hello,
Chris hat geschrieben:DerPhysiker hat geschrieben:Most likely, you are either running out of RAM
Hmm.... perhaps 2GB physical and 2GB swap wasn't enough after all

That should be enough. I don't know larger examples.
Chris hat geschrieben:
Low RAM might be an explanation for a sudden slowing, but this is a linear slowing - each block actually takes longer than the previous, and the increase is steady. I'm able to reliably reproduce the each-block-loads-proportionally-more-slowly-than-the-last on machines with variable amounts of RAM and swap. With less RAM, the time increments are a little longer.
micha88 hat geschrieben:The file is also processed, not only copied into memory.
This doesn't explain a gradual slowdown. Data processing is generally either linear or random, not exponential. In mathematical terms, processing the nth block of data should be O(1) (total time O(n)) rather than O(n) (total time O(exp n)). The
position of a block of data should not affect how long it takes to process that specific block alone (the important part -
not counting all the blocks already done or still to do).
The data -as stored in the layout file- and the data -as stored in memory- are quite different things.
The file is a linear stream of all that is needed as information, with low redundance. Connections between objects are shown as handles (each thing that has a name, also has an internal handle). These data can be read and written linear, but it is hard to search a certain entry inside them, e.g. a certain signal or turnout. However, while stored on the disk, such a search is never needed.
The data in memory are organized in a more complex way. There are many objects, that have connections between them. While running the simulation of a large layout, it is necessary to find connected objects quickly, and not by search in a long linear data list. For that, there exist many direct links. Ofcourse, they are not stored in the file, because it would be nonsense to store address pointers in a file. But, on loading, these connections are created "on-the-fly". For instance, all signal systems own a list of pointers to the elements they are assigned, and vice-versa the elements are linked to the signal systems. The time needed to create these data, is not linear depending on the amount. In result, you may load a large layout quickly when it does not contain signals, but you may need much more time for a smaller layout file that contains some thousand signals with complicated connections.
Also, in some case BAHN makes tests for data integrity on loading, i.e. for unique handles or unique names. To test whether something is unique, you need to check all the other objects that you already have loaded. This is not linear depending on number of objects.
However, the most of these tests are turned off when loading files of current file version.
Similar is sorting: Some objects are sorted by name, number or co-ordinates, and the search algorithms rely on that. However, there are known some situations of data mismatch by bugs in programming of earlier versions. In result, it is a good way to re-sort the objects on loading. However, for many objects of same type this may need some time, and ofcourse, it is not linear.
Chris hat geschrieben:
As for the different sorts of information being used, I believe the the part where things are initialised is labelled as such, and uses a percentage indicator (shortly followed by a slew errors for where I've got out-of-date graphics files

).
A percentage indicator needs to know the amount of data before starting, to define what "100%" really means. However, it is not an information that makes really sense when you take the length of a BAHN layout file.
Chris hat geschrieben:
Granted, this is only happening with really big layouts, but the exponential nature means that throwing more RAM and faster hardware at it will not improve things...
Yes. Many extensions and algorithms result in something greater than O(1).
Greetings
Jan B.